Whatever happens in the rest of his career, Roger Federer will never forget a warm Melbourne night when he confounded the odds and wrote an extra chapter into his extraordinary history.

His 6-4, 3-6, 6-1, 3-6, 6-3 victory over Rafael Nadal, a man who has caused him no end of disappointment in the past, gave him a record 18th grand slam title – his first for four and a half years – little short of miraculous and arguably the most amazing moment in his career.

“The magnitude of this match is going to feel different,” an exhausted but elated Federer said. “It’s an amazing feeling.”

“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. I think it will take some time to sink in. When I go back to Switzerland, I'll think, wow.

This sort of thing shouldn’t happen. At 35, with no match practice for six months as he rested his ailing knee, he arrived in Melbourne unsure of what was in store, a rare feeling for a man who for so long dominated the tennis world.

But in the back of his mind there was the voice of his long-time coach, Severin Luthi, who told him, even when he was focused on rehab instead of tennis, that anything was possible. “He said, you can win the Australian Open,” Federer said. “I guess he was right.”

In a career of incredible achievements, from the career grand slam to five straight Wimbledon victories and 302 weeks at world No 1, this may just be the best of the lot, not least since Nadal is a man who has dealt him so much pain in the past.

“I couldn’t be happier,” he said. “(Before the start), I would have said a great event would be quarters. That was before I had the draw. I went so much further than I thought I could. Then when you are in the semis and finals, you think maybe it’s possible. Then in the final, I just said, believe, fight and maybe get lucky. I really got lucky tonight.

“I did believe that I had the game and the mental and physical capabilities to do it again. I knew it wouldn’t be easy but…I never lost belief.”

Federer had the advantage of an extra day to recover from his semi-final win over Stan Wawrinka while Nadal had a quick turnaround after an epic, near five-hour semi-final win over Grigor Dimitrov.

Though Federer, at 35 and battling a sore thigh, had more time, Nadal looked a step slower than normal early on, leaving some balls he had run down against Dimitrov.

That enabled Federer to believe that he could stick to his game-plan of taking the ball early and hitting through his backhand rather than slicing it, never allowing himself to get into those long, bruising rallies that Nadal loves so much.

In truth, the first four sets were up and down as first one man and then the other grabbed the ascendancy.

Federer took an injury timeout at the end of the fourth set and with Federer not having won a fifth set against Nadal since 2007, the odds seemed stacked in the Spaniard’s favour.

When Nadal broke for 1-0 in the fifth and saved break points to extend his lead to 3-1, even Federer, as he admitted, thought it might be over, but he broke back for 3-3, held easily in the following game and broke again for 5-3, despite some brave play from Nadal in saving four more break points.

Serving for his first grand slam title since Wimbledon in 2012, Federer fell behind 15-40 but saved both break points brilliantly before forcing match point.

His second serve on match point was initially called out and as he waited for the challenge, Federer wondered if it might all slip away.

The challenge went in his favour and though Nadal saved the match point, Federer forced another and sent another forehand out of the reach of Nadal.

The ball was called in but there was still time for more drama as Nadal challenged. “I knew the forehand was in,” Federer said later, and it was, prompting wild celebrations in his support team, which included his wife Mirka, and his coaches Luthi and Ivan Ljubicic.

Nadal was proud of his effort, having recovered from a wrist injury that affected him for much of 2016 and forced him to miss Wimbledon and the Olympics.

“I am with big personal satisfaction,” he said. “I cannot say that I am sad. I wanted to win, yes, but I am not very sad. I did all the things that I could. I worked a lot during all these months. I keep working, and I competed well.

“I enjoyed the competition. I won against the best players of the world, and I competed well against everybody. That's the most important thing for me, and that gives me confidence to keep playing, and that's what I going to try. If I keep going like this, I think I can do something special, especially on clay.”

In his on-court speech, Federer said he “hoped to be back next year but if not, this was a wonderful run here.”

Surely he is not about to retire, not when he is winning grand slams again?

“Look, I've had a tough year last year,” he said. “Three five-setters are not going to help. I just meant it the way I meant it. There wasn't something planned behind it, that this is my last Australian Open. I hope can I come back, of course. That's my hope right now.”

If he does, he will come back as the champion once more.