1 of 4
Kerstin Joensson, Associated Press
Barcelona players celebrate their victory at the end of the soccer Champions League second leg semifinal match between Bayern Munich and FC Barcelona at Allianz Arena in Munich, southern Germany, Tuesday, May 12, 2015.

MUNICH — Barcelona advanced to the Champions League final for the first time since 2011, getting a pair of Neymar goals and cruising to a 3-2 loss at Bayern Munich on Tuesday night for a 5-3 aggregate victory in their semifinal matchup.

Seeking its fifth European title, Barcelona will play defending champion Real Madrid or Juventus at Berlin on June 6. Host Real tries to overturn a 2-1 deficit in Wednesday's semifinal.

Trailing after a 3-0 loss at Barcelona last week, Bayern went ahead when Medhi Benatia scored on a header off a corner kick in the seventh minute.

Neymar scored eight minutes later, and the away goal meant Bayern needed a four-goal victory to advance, and Neymar's second goal, his 37th this season, put Barcelona ahead 2-1 in the 29th.

Bayern got goals from Robert Lewandowski in the 59th and Thomas Mueller in the 74th. Bayern coach Pep Guardiola, who coached Barcelona to 14 titles from 2008-12, exchanged an extended hug with current Blaugrana coach Luis Enrique after the final whistle.

Seeking its fourth European title in 10 seasons with Lionel Messi, Barcelona will be in what could be the second straight all-La Liga final after Real's win over crosstown rival Atletico last year. Led by a combined 114 goals from Messi (53), Luis Suarez and Neymar (24), the Blaugrana are in the European final for the eighth time.

Bayern, the 2013 champion under coach Jupp Heynckes, was knocked out for the second straight season in the semifinals under Guardiola, who has said he will stay for the final season of his contract and not leave to manage Manchester City.

Bayern, which has clinched its third straight Bundesliga title, was hampered by injuries to wingers Arjen Robben and Franck Ribery.