Roger Federer shrugged off a decade of grand slam heartbreak against Rafa Nadal, felling his great rival 6-4 3-6 6-1 3-6 6-3 in a classic Australian Open final to capture his 18th major title.

Roared on by a partisan Rod Laver Arena crowd on Sunday, Federer roared back from 3-1 down in the nerve-shredding final set before closing it out on the second championship point with a forehand winner to seal his fifth crown at Melbourne Park.

Seeded 17th and playing his first tour tournament after six months out of the game, Federer capped his brilliant comeback from injury with his first grand slam title since Wimbledon in 2012.

READ MORE: The elite tennis coach who sleeps in his car

The win made Federer the first player ever to win five titles at three different grand slams and at 35, the oldest grand slam winner since Ken Rosewall won the 1972 Australian Open at 37.

Federer was forced to endure a nervous wait for his victory after Nadal unsuccessfully challenged the line call on the second championship point.

But he was finally able to celebrate with tears in his eyes after coming out on top after three hours and 38 minutes of enthralling tennis to become the first man to win five or more titles at three different grand slams.

"There are no draws in tennis but I would have been happy to share one with Rafa tonight," he said.

"I wasn't sure if I was going to make it. I hope to see you next year and if not it's been a wonderful run here."

Nadal, the 2009 champion, was typically gracious after losing his third Melbourne final and coming up short in his bid for a 15th grand slam title.

"Congrats to Roger, just amazing the way he's playing after so long away from the tour," the 30-year-old said.

Source: Reuters news agency