Rafael Nadal arrived in London with a new wife and an old abdominal injury, his mood turning angry and dark when he had to deny that either were in any way linked to each other or his form on the court, a suggestion that hovered on the outer edges of good taste and credulity. He was not a happy Spaniard.

However, the boyish smile returned with interest when he came from 5-1 down in the third set to defeat the languid young Russian Daniil Medvedev in one of the great comebacks of his long career.

For long stretches of the match Medvedev proved a more persistent inquisitor than any journalist but he fell asleep at the wrong time as Nadal roared back at him to win 6-7 (3), 6-3, 7-6 (4) in 2hr 46min. The victory keeps him in the picture for the semi-finals and gives him an outside chance of hanging on to his world No 1 ranking.

Novak Djokovic and Roger Federer face off with Wimbledon memories fresh Read more

As he said courtside: “I was super lucky. Sorry for Daniil. It was a tough loss. He was playing much better than me in the third. When you have the first break at 3-5, you’re only one break away. That moment, I thought I had a chance. I think I played better at the end. Generally, I played better than I did two days ago.”

Asked from where he dredged up the will to win, he said: “A lot of the years on the Tour, and I love what I’m doing. I love this sport. That is the biggest motivation.”

Nadal, whose level dipped when losing against Alexander Zverev in the first round, lifted his game against the Tour’s in-form player to provide quality entertainment and drama for the packed afternoon crowd at the O2 Arena. It is a tournament he has never much cared for but this was a day for him to cherish.

He insisted before the tournament he would not let thoughts of next week’s Davis Cup finals in Madrid intrude on his preparation, nor worry about the state of an abdominal injury that forced him to quit before the semi-finals in Paris last week. Now he is mentally buoyed for Spain’s push at the Davis Cup, which starts on Monday. He needs to reach the final here to hold on to his world No 1 ranking, an honour that is now within reach of Novak Djokovic, who lost a three-set thriller against Dominic Thiem on Tuesday night and must resist the challenge of Roger Federer on Thursday .

As light as a gazelle on his spindly legs, Medvedev sought to keep it lively across the baseline while Nadal, uncoiling his lefty forehand, also searched for openings nearer the corners. They slugged it out on level terms for half an hour, Medvedev failing to cash in on the first break opportunity. The pressure grew but he held his nerve and his serve at 5-6 to force the tie-break. Nadal dumped a forehand and Medvedev served out after 53 minutes, nearly as long as a couple of the earlier matches.

The backlash came quickly and hard. Nadal went 2-0 up in the second but had to play near his best to keep Medvedev at bay. He did so calmly, forcing a wild swipe from his opponent on a third set point that brought him level after an hour and 34 minutes.

Medvedev, who has won two Masters titles and 29 matches since Wimbledon, is on a streak players dream of, and he showed all his class to break at the start of the deciding set. In the third game he produced a hat-trick of sublime skill to break again – the winning point an outrageous cross-court chip –and the match was his to lose.

ATP head Chris Kermode admits to ‘hurt’ at being ousted by players Read more

Embedded in the zone, Medvedev did not give his revered opponent even a charitable glance as he raced to 4-0 and break point in the fifth, but the indignity of being bagelled lit a flame under Nadal and he held through a string of painful deuce battles. Medvedev, who has defeated Djokovic twice this year, was cruising to a hat-trick of world No 1 victims or the season fwhen a careless backhand cost him his serve in the eighth game. Rejuvenated by the screams of “Vamos Rafa!” in the darkened stands, Nadal launched his comeback. He held quickly to 15 for 4-5, and Medvedev was clearly rattled.

Serving for the match the Russian saved two of three break points but, volleying off his second serve, he could not control a stretched return at the net, and Nadal was all over him again.

Having blown match point on Nadal’s serve at 5-1, Medvedev was serving to stay in the match after two and a half hours against an inspired legend who had just taken 17 of the previous 21 points. An ace, his 21st, helped Medvedev to force a second shootout and he looked to have regained his composure in time. But a rash forehand cost him match point, and another on the backhand sealed his fate.

In the evening match, Stefanos Tsitsipas sealed his semi-final spot in emphatic style with a 6-3, 6-2 win over Zverev. Nadal will have watched on with interest. He must beat the Greek tomorrow to have a chance of advancing.