We should never have doubted him. Five years after winning his last Grand Slam title, 35-year-old Roger Federer claimed the 18th of his extraordinary career when he won the Australian Open with perhaps his greatest victory.

The final against his old rival, Rafael Nadal, was always going to provide a remarkable climax to this event, but few could have imagined that it would produce a finish as stunning as Federer conjured with his 6-4, 3-6, 6-1, 3-6, 6-3 victory.

The oldest man to play in a Grand Slam final for 43 years had appeared to be heading for an honourable defeat when he left the court for treatment on a leg problem after losing the fourth set and was then broken in the opening game of the decider. Federer, however, dug deep to break Nadal twice and then serve out to complete his stunning victory after three hours and 37 minutes.

The greatest player in history was in tears afterwards and, for once, seemed almost lost for words during the presentation ceremony, though as usual he found the right tone. “There are no draws in tennis but I would have been happy to share one with Rafa tonight,” he said.

When Federer missed the last six months of 2016 with a knee injury few would have imagined he could come back and do this. After winning his 16th Grand Slam title here seven years ago he had added just one to his tally, at Wimbledon in 2012, since when there has been frequent speculation as to when he might retire.

However, at 35 Federer has become the oldest male Grand Slam singles champion since Ken Rosewall won this title in 1972 at the age of 37. As the world No 17 Federer is also the lowest ranked Australian Open champion since Thomas Johansson (world No 18) in 2002 and the lowest ranked at any Grand Slam event since Gaston Gaudio (world No 44) at the 2004 French Open. He will rise to No 10 in Monday’s updated world ranking list, while Nadal will climb to No 6.

Federer’s fifth Australian Open came seven years after his first, which is the longest gap between titles here in the Open era. He is the first man in history to win five or more titles at three different Grand Slam events, having also won seven Wimbledons and five US Opens.

Federer celebrates after breaking his opponent's serve (Getty)

Nadal, who has also returned from injury this month after a wrist problem, had won six of his previous eight Grand Slam finals against Federer, who had beaten him only in the Wimbledon finals of 2006 and 2007.

The defeat was clearly a disappointment for Nadal, who had also been a break up in the deciding set when he lost to Novak Djokovic in the final here five years ago, but the 30-year-old Spaniard can take great heart from his achievement in reaching his first Grand Slam final since winning his ninth French Open in 2014.

Federer, who said his team would be “partying like rock stars” later in the night, thought it would not be until he returns to Switzerland that he will appreciate what this victory means to him. “The magnitude of this match is going to feel different,” he said. “I can’t compare this one to any other one except for maybe the French Open in 2009. I waited for the French Open. I tried, I fought. I tried again and failed. Eventually I made it. This feels similar.”

After a glorious summer’s day the temperature was a balmy 25C when the players entered Rod Laver Arena. It was hard to judge who received the louder of two thunderous ovations, but it soon became clear that Federer was the man most wanted to win.

It was a match full of remarkable drama and some excellent tennis, though in terms of quality it could not compare with some of their previous finals. The two men were rarely at their best at the same time and one was clearly on top in each of the first four sets. The best tennis came in the decider as Federer went for broke and Nadal tried to hang on to his lead.

Nadal reaches to return a shot from Federer (Getty)

In the opening set Nadal struggled to find his range as Federer dictated the pace, making the only break of serve in the seventh game. A change of tactics brought an immediate reward for Nadal in the second set. The Spaniard played further up the court and hit his forehand with more power and top spin into Federer’s backhand, which has so often proved a winning ploy for him in the past. Nadal was soon 4-0 up and although Federer retrieved one break the Spaniard took the set with something to spare.

Nadal pushed hard again in the opening game of the third set but Federer, crucially, held firm. Nadal had three break points and Federer saved each of them with an ace fired with pinpoint accuracy beyond the reach of his opponent’s forehand. From that moment Federer started to serve better and also found great rhythm on his backhand. He broke serve in the second game with some stunning returns and again before taking the set.

The momentum was now clearly with the Swiss, but once again Nadal turned the tables, breaking in the fourth game of the fourth set and then serving out to level at two sets apiece.

Just as he had in his semi-final victory over Stan Wawrinka, Federer left the court at the end of the fourth set for treatment on an upper leg injury and once again he returned to complete a memorable victory.

Federer had to receive treatment at one point (Getty)

Nadal broke serve in the opening game of the deciding set, but for most of it he was the man under pressure from Federer’s bold shot-making. The Spaniard saved break points in the second and fourth games, but Federer broke to level at 3-3 and again to lead 5-3 in a game full of breath-taking points, including one 26-shot rally which ended with the Swiss cracking a sensational forehand winner down the line.

Serving for the match, Federer went 15-40 down but saved two break points with an ace and a thumping inside-out forehand winner and went on to convert his second match point with a forehand winner.

Ivan Ljubicic, who joined Federer’s entourage last year, and Severin Luthi, a long-time member of his coaching team, led the celebrations in Federer’s player box. “It’s obviously special for the entire team,” Federer said later. “It was Ivan’s first Grand Slam final as a player or as a coach. Obviously he was nervous all day. I tried to calm him down. The same thing with my physio, too. I think I could sense that this wasn’t something that he’s seen so many times.”

Asked how he had come back in the deciding set, Federer said: “I told myself to play free. That’s what we discussed with Ivan and Severin before the matches. You play the ball, you don’t play the opponent. Be free in your head, be free in your shots, go for it. The brave will be rewarded here.”

Rafael Nadal at the Australian Open Grand Slam tennis tournament in Melbourne, Victoria (EPA)

He added: “I kept on fighting. I kept on believing, like I did all match long today, that there was a possibility I could win this match. I think that's what made me play my best tennis at the very end.”

Nadal admitted afterwards that he had sometimes lacked a little speed in his legs following his five-hour victory over Grigor Dimitrov in the semi-finals on Friday night, but said that Federer had deserved his victory. “It was a great match,” Nadal said. “After I had the break in the fifth set he played very aggressively, hitting a lot of great shots, so it was tough to hold serve every time.”

Federer said at the presentation ceremony that he hoped to be back next year, “but if not, then it was a wonderful year here and I couldn't be happier tonight.”