MADRID (AP) — The “Si se puede! (Yes we can!)” chants gradually faded at the Santiago Bernabéu as the minutes passed and Real Madrid looked beaten.

As the end of regulation approached, many in the stands — and on the field — were close to giving up as Manchester City defended its 1-0 lead.

It seemed that there would be no magical night at the Bernabéu for the 13-time European champions this time.

But Madrid took its Champions League comebacks to another level on Wednesday, rallying late with two goals in two minutes by substitute Rodrygo to force extra time and defeat Manchester City 3-1 to reach the final — a showdown with Liverpool.

Karim Benzema, the hero of Madrid’s previous comebacks this season, converted a penalty kick in extra time for the decisive goal that allowed Madrid to advance 6-5 on aggregate after a 4-3 first-leg semifinal loss in which it escaped losing by a bigger margin.

“I didn’t think we could do it again because we were struggling,” Madrid goalkeeper Thibaut Courtois said. “We had already eliminated some top teams that spent a lot of money to try to win a Champions, but today it was more impressive, happening in the final minutes.”

Madrid had already pulled off thrilling comebacks at the Bernabéu against Paris Saint-Germain in the round of 16 and Chelsea in the quarterfinals.

“I cannot say we are used to living this kind of life, but what happened tonight happened against Chelsea and also against Paris,” Madrid coach Carlo Ancelotti said. “If you have to say why, it is the history of this club that helps us to keep going when it seems that we are gone.”

By doing it again against City, Madrid booked a spot in the May 28 final in Paris against Liverpool, which advanced after defeating Villarreal on Tuesday. Madrid defeated Liverpool in the 2018 final, when the Spanish powerhouse clinched its record-extending 13th title.

“We have a score to settle,” Liverpool forward Mohamed Salah said on Twitter after Madrid’s win.

The result ended City’s latest quest for its first Champions League trophy. Pep Guardiola’s team lost in the final last year to Chelsea.

“We were close but at the end we could not reach (the final),” Guardiola said.

Madrid looked defeated near the end of regulation before Rodrygo scored his goals two minutes apart. Riyad Mahrez had put City ahead in the 73rd but the Brazilian forward equalized in the 90th and got the go-ahead goal with a header a minute into stoppage time.

A few minutes before Rodrygo’s first goal, Ferland Mendy had saved Madrid from conceding a second goal that could have sealed City’s qualification by clearing the ball in front off the goal line while tumbling backward to keep an attempt by Jack Grealish from going in.

Madrid goalkeeper Thibaut Courtois moments later saved a Grealish shot with the bottom of his cleat.

Madrid carried all the momentum into extra time and Benzema gave the hosts the 3-1 lead by converting a 95th-minute penalty kick after he was fouled inside the area.

It was the 15th Champions League goal this season for Benzema, the competition’s leading scorer. It was his 10th goal in the knockout stage alone, tying Cristiano Ronaldo’s record in a single season.

Benzema had scored hat tricks when Madrid rallied against both PSG and Chelsea. Madrid came back against PSG after losing the first leg in Paris and conceding early in the second leg at the Bernabéu. Against Chelsea, Madrid won the first match 3-1 but was down 3-0 in the second leg before rallying in extra time, when Benzema again scored the deciding goal.

Wednesday’s game started tighter than last week’s back-and-forth first leg in Manchester, but City eventually opened the scoring when Mahrez found the top corner with a firm left-footed one-timer from inside the area following a pass by Bernardo Silva, who attracted the Madrid defenders before feeding the ball to his teammate.

Mahrez had scored both of City’s goals in the second leg of last season’s semifinal against PSG. The Algerian became the first City player to scored seven times in a single Champions League campaign.

Madrid had scored 22 goals in its last eight games in all competitions but struggled to get past the City defense.

Benzema set up Rodrygo’s first goal from inside the area, and Marco Asensio flicked Dani Carvajal’s cross for the Brazilian’s stunning header in stoppage time.

Rodrygo had scored twice when Madrid clinched the Spanish league title in advance at the Bernabéu on Saturday, when celebrations went late into the evening with players and coach Carlo Ancelotti asking for the fans’ support against Man City.

Fans had already given players a spectacular welcome as the team’s bus arrived before the match on Wednesday, crowding the streets around the Bernabéu.

___

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP_Sports

___

Tales Azzoni on Twitter: http://twitter.com/tazzoni