Rafael Nadal saved a match point at 5-1 down in the third set before rallying to beat Daniil Medvedev 6-7 (3), 6-3, 7-6 (4) at the ATP Finals on Wednesday, keeping alive his chances of advancing from the group stage.

The Spaniard looked headed for a second straight loss at the season-ending tournament but won five games in a row to go 6-5 up in the deciding set. In the tiebreaker, Medvedev missed a routine forehand to hand Nadal a match point and then sent a backhand just wide. That shot was initially called in but was overturned by Hawk-Eye after Nadal challenged the decision.

The win gives Nadal a 1-1 record after two matches, while Medvedev fell to 0-2. Stefanos Tsitsipas was set to play defending champion Alexander Zverev in the evening match, with both players looking for a second win.

Rafael Nadal of Spain serves to Daniil Medvedev of Russia during their ATP World Tour Finals singles tennis match at the O2 Arena in London, Wednesday, Nov. 13, 2019. (AP PhotoKirsty Wigglesworth)

Rafael Nadal of Spain serves to Daniil Medvedev of Russia during their ATP World Tour Finals singles tennis match at the O2 Arena in London, Wednesday, Nov. 13, 2019. (AP PhotoKirsty Wigglesworth)

In a rematch of this year’s U.S. Open final, Nadal came out looking much sharper than in his opening loss to Zverev and broke Medvedev twice in the second set.

But the Russian raced out to a 4-0 lead in the third set and had two more break points in the next game. However, Nadal held and then saved a match point at 30-40 in his next service game with a backhand drop shot at the net.

Nadal’s win also strengthens his grip on the year-end No. 1 ranking, as it means Novak Djokovic has to win the tournament to have any chance of overtaking him. Djokovic first has to beat Roger Federer on Thursday just to advance to the semifinals.

Daniil Medvedev of Russia sits in his chair in a break during the ATP World Tour Finals singles tennis match against Rafael Nadal of Spain at the O2 Arena in London, Wednesday, Nov. 13, 2019. (AP PhotoKirsty Wigglesworth)

Daniil Medvedev of Russia sits in his chair in a break during the ATP World Tour Finals singles tennis match against Rafael Nadal of Spain at the O2 Arena in London, Wednesday, Nov. 13, 2019. (AP PhotoKirsty Wigglesworth)

More AP Tennis: https://www.apnews.com/apf-Tennis and https://twitter.com/AP_Sports