MADRID (AP) — A day after rushing from his victory to watch Real Madrid play Manchester City in the Champions League semifinals, Rafael Nadal needed the same fighting spirit as his favorite team showed to avoid his own elimination at the Madrid Open.

The “Si se puede!" ("Yes we can!") chants that echoed at the Santiago Bernabéu Stadium on Wednesday were also present at the “Caja Mágica” on Thursday after Nadal saw himself against the ropes, like Madrid was the night before.

While Madrid scored twice in the final minutes to force extra time and defeat Man City, Nadal saved four match points to secure a three-set win over David Goffin and reach the quarterfinals.

“Our trajectory is about fighting, is about believing, is about trying till the last, until the match is done,” Nadal said. “We are a kind of team and player that we try till the end and we believe. So, yeah, yesterday (has) been unforgettable. Today of course for me is too.”

Nadal asked tournament organizers not to schedule his opening match Wednesday in the afternoon session so he could make it to the Bernabéu. He is an honorary member of the club and last week gave the ceremonial kickoff before the team clinched the Spanish league title with a win against Espanyol.

The third-seeded Nadal will next face Carlos Alcaraz, the youngster touted by many in Spain as Nadal's successor. The ninth-ranked Alcaraz marked his 19th birthday by defeating Cameron Norrie 6-4, 6-7 (4), 6-3. Tournament organizers greeted him with a cake on the court after the match, and the home crowd sang “Happy Birthday.”

The fourth-ranked Nadal needed more than three hours to defeat the 60th-ranked Goffin 6-3, 5-7, 7-6 (9) in only his second match after a six-week layoff because of a rib stress fracture.

“I knew before I arrived that this was going to be a complicated week,” Nadal said. “Whatever happens now, to win two matches here is fantastic news for me.”

Nadal was up 5-3 in the second set before being broken twice and squandering a couple of match points to allow Goffin to even the match. He also struggled in the third and faced four match points in the tiebreaker. The first was saved with an ace, and Goffin hit the net on the second. On the next two, Nadal needed a couple of perfectly executed drop shots to stay in the match.

“It was an incredible end to the match, but it should have never gotten to that point. I had it under control at 5-3," Nadal said. “But we know that things are not perfect for me right now, I have to accept that. I fought until the end, it's what I can expect from myself now.”

Nadal’s 1,050th career victory came after Andy Murray withdrew from his match against Novak Djokovic because of a stomach illness.

Murray, a two-time champion, announced he had to withdraw not long before he was scheduled to take the court against the top-ranked Djokovic in the third round.

It would have been the first time Murray and Djokovic played against each other since the Serb won the Doha final in 2017.

The 78th-ranked Murray had won his first two matches in Madrid. The former No. 1 hadn't won consecutive matches since January and hadn't played in a clay-court tournament in nearly two years after undergoing hip surgery.

Djokovic automatically advanced to the quarterfinals — his second of the year after losing the Serbia Open final last month. His opponent will be 12th-seeded Hubert Hurkacz, who defeated qualifier Dusan Lajovic 7-5, 6-3.

Andrey Rublev, who beat Djokovic in the Serbia final, advanced to the quarterfinals after a hard-fought 7-6 (7), 7-5 win over Daniel Evans in nearly 2 1/2 hours.

Rublev will next face fourth-seeded Stefanos Tsitsipas, who comfortably defeated Gregor Dimitrov 6-3, 6-4.

Defending champion Alexander Zverev advanced after qualifier Lorenzo Musetti retired with a left thigh injury while losing 6-3, 1-0.

In the women's semifinals, eighth-seeded Ons Jabeur comfortably defeated qualifier Ekaterina Alexandrova 6-2, 6-3 in just over an hour to advance to the final. The Tunisian is the first Arab player to reach a WTA 1000 final.

The 10th-ranked Jabeur, the only top-10 player left in the women's draw, had lost five of her six matches against Alexandrova from 2016-2018.

It will be her sixth final, and first since a runner-up finish in Charleston last month.

“This match is going to be different (from the Charleston final)," Jabeur said. “I’m just going to really give my best. I don’t want to regret, saying like, ‘should I have done this, should I have done that...’”

She will face 12th-seeded American Jessica Pegula, who defeated Jil Teichmann 6-3, 6-4 to also make her first WTA 1000 final.

Pegula and Jabeur are tied 2-2 in head-to-head meetings.

___

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

___

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