BARCELONA, Spain — Playing with an extra man for more than an hour, Paris Saint-Germain rallied against Barcelona to reach the Champions League semifinals.

Kylian Mbappé scored twice as PSG reversed its first-leg loss at home with a 4-1 win at Barcelona on Tuesday to advance 6-4 on aggregate and keep alive its hopes of a first European title in what is the France star's final season with the club.

Former Barcelona forward Ousmane Dembélé and Vitinha also scored for PSG, which took advantage of a 29th-minute red card to Barcelona defender Ronald Araujo after he fouled Bradley Barcola while trying to stop a breakaway.

''When it was 11 against 11 we were well organized. The sending off changes everything. The match changed completely,'' said Barcelona coach Xavi Hernández, who was later sent off himself for complaining. ''We would have liked to play PSG 11 against 11. That should not have been a red card.''

Barcelona had gotten off to a good start and opened the scoring with a goal by Raphinha in the 12th, but the visitors took control with the man advantage and didn't let Barcelona get back into the game. Xavi had to replace young forward Lamine Yamal with defender Iñigo Martínez after the red card to Araujo, who was deemed by the referee to be the last defender when he fouled Barcola.

PSG is back in the semifinals after two consecutive eliminations in the round of 16.

''I feel very proud," said PSG coach Luis Enrique, a former Barcelona player and coach. ''We showed what we wanted to do here today. We conceded a goal, but we stayed intact mentally. We continued to play, to attack. We did everything we could to be better than Barcelona. My players showed a lot of character, a lot of enthusiasm, a lot of desire.''

The Catalan side, which won the first leg 3-2 in Paris last week, made it to the knockout stage of Europe's top club competition after back-to-back eliminations in the group stage.

In the other quarterfinal on Tuesday, Borussia Dortmund defeated Atletico Madrid 4-2 at home to advance 5-4 on aggregate. PSG and Dortmund will meet in one of the semifinals.

Mbappé scored his goals in the 61st and 89th minutes. The France star is hoping to win what would be a first Champions League title for himself and for PSG before he leaves the club.

Barcelona opened the scoring in its first attack with a fortuitous goal by Raphinha after Lamine Yamal's low cross from the right side bounced off the shin of the Brazil forward and went into the net.

PSG equalized about 10 minutes after Araujo was sent off, with Dembélé finding the net by the far post after a cross by Barcola. Dembélé, named the man of the match, was loudly jeered by the Barcelona crowd when he was substituted in the final minutes. He had also scored in the first leg in Paris.

''We didn't give up, we knew we were going to score goals here,'' Dembélé said. ''A big shift from the whole team. We worked the entire week, tactically, with the coach. His tactics were perfect. Even though we conceded the first goal, we didn't let our heads drop. We continued to believe.''

PSG took the lead when Vitinha fired a low shot from outside the area in the 54th. The visitors increased their lead when Mbappé converted a penalty kick after Dembélé was brought down by João Cancelo inside the area.

Barcelona had chances to get back into the game, with Ilkay Gündogan hitting the post in the 56th and both Robert Lewandowski and Raphinha squandering chances toward the end of the match.

Mbappé's second goal came from close range in a breakaway in the final minutes. He has now scored at least 40 club goals in all competitions for the third time in four seasons with PSG. He has scored 13 goals in his last 13 Champions League matches.

Xavi was sent off after kicking a cushion protecting a sideline camera in the 56th.

___

More AP soccer: https://apnews.com/hub/soccer