Rafael Nadal fought back from two sets to one down to defeat Juan Martin del Potro in a superb match and set up a blockbuster Wimbledon semi-final against Novak Djokovic.

When Del Potro sent a forehand rifling down the line to take the third set, it seemed Nadal might be following Roger Federer out of the tournament.

But the world number one recovered superbly to triumph 7-5 6-7 (7/9) 4-6 6-4 6-4 and keep alive his hopes of an 18th grand slam title.

Nadal should have led by two sets to love but was forced to come from behind before withstanding a supreme effort from his opponent in the fifth, to clinch victory after four hours and 47 minutes.

The second seed said: “It was a very emotional match, a great quality of tennis, especially in the last set. Sorry for Juan Martin, he’s an amazing opponent. In some ways he deserved the victory, too.

“Today was for me. Last year I lost a match (against Gilles Muller) 15-13 in the fifth. It’s very important for me to be back in the semi-finals. It’s a great thing.”

The clash between Del Potro’s thunderous forehand and Nadal’s supreme defensive skills was a stalemate until the 12th game of the opening set, when the Spaniard pounced.

Nadal was at his wall-like best, and Del Potro could only look at his opponent in bemusement when, at 2-3 in the second set, he threw everything into an enormous forehand only to see it batted back past him for a winner.

But then, out of nowhere, Del Potro broke. Whether it was the gasp from the crowd when the score in Federer’s match flashed up on the scoreboard that disrupted Nadal’s concentration or something else, he played his poorest game of the match to leave his opponent serving for the set.

Back came Nadal to force a tie-break, and he looked sure to move two sets ahead when he opened up a 6-3 lead in the tie-break.

However, Del Potro saved two set points on his own serve and then Nadal double-faulted. He had one more chance but again the Argentinian sent down a big serve and then, when his own chance came, he drilled a bullet forehand off the top of the net and onto the sideline.

The chink in Nadal’s armour was there again in the 10th game of the third set. Having cruised through his service games, he was broken to love serving to stay in it, Del Potro finishing it off with a scorching forehand down the line.

Nadal produced one of the shots of the match in the opening game of the fourth, launching himself through the air to hit a backhand, only to miss the follow-up forehand. It rather summed up his evening to that point but the world number one oozes resilience and back he battled to force a decider.

Del Potro and Nadal were certainly providing plenty of entertainment for the crowd, who had overwhelmingly chosen tennis over football. A lengthy third game saw the Argentinian score with a diving volley before Nadal chased a forehand so hard he ended up among the fans.

The end looked nigh when Nadal broke for 3-2 but he tightened up and Del Potro kept hammering his forehand. Time and again the fifth seed threatened to get back on terms but five break points came and went and somehow Nadal held on.

Del Potro ended the match prostrate on the grass as Nadal held his arms aloft, before crossing to the other side of the net for a consoling, and exhausted, hug.