It was the 35-year-old Federer's first major title since Wimbledon in 2012.
Melbourne: Roger Federer won his 18th Grand Slam title and put some extra distance on the all-time list between himself and Rafael Nadal, the man he beat in a vintage five-set final at the Australian Open final.
It was the 35-year-old Federer's first major title since Wimbledon in 2012, his first in Australia since 2010, and it reversed the status quo against his nemesis, Nadal.
"Against Rafa it's always epic," Federer said after Sunday's 6-4, 3-6, 6-1, 3-6, 6-3 victory. "This one means a lot to me because he's caused me problems over the years."
Federer had lost six of the previous eight Grand Slam finals he'd played against Nadal and was 11-23 in their career meetings. He also hadn't beaten the left-handed Spaniard for a major championship since Wimbledon in 2007.
"It remains for me the ultimate challenge to play against him," Federer said. "It's super sweet, because I haven't beaten him a Grand Slam final for a long time now."
With big wins come big celebrations, Federer said. "We're going to party like rock stars tonight."
Federer had lost three major finals since winnings his 17th, and by winning in Melbourne, he became the oldest man since Ken Rosewall in 1972 to win a slam.
Both players were returning from extended layoffs - Federer for six months after Wimbledon with an injured left knee; Nadal for a couple of months with an injured left wrist - and were seeded 17th and ninth, respectively.
"I wasn't sure I was going to make it here but here I am - we made it," Federer said after accepting the trophy from Australian great Rod Laver. "Tennis is a tough sport, there's no draws. If there was going to be one, I would have been happy to have it tonight and share it with Rafa, really."
After twice coming back from a set down, Nadal was a break up in the fifth until Federer regained control and ultimately became the first man in the Open era to win three of the Grand Slam events at least five times (7 Wimbledon, 5 U.S. Open, 5 Australian Open and 1 French Open title).
Nadal remains equal second with Pete Sampras on the all-time list with 14 - and none since the 2014 French Open.
After four sets where the momentum alternately swung, the fifth had all the tension and drama that these two players are famous for.
Nadal went up an early break and it seemed as if the injury time-out Federer needed for his right leg in between sets may have been an indicator of things to come.
But the Swiss star rallied, broke back and took control in a period when he won 10 straight points.
Nadal saved three break points in the eighth game but lost momentum again when Federer finished off a 26-shot rally - the longest of the match - with a forehand winner down the line.
Federer got the pivotal break later that game for 5-3, but Nadal made him work for the very last point.
Serving for the match, and after saving two break points, Federer was called for a double-fault at deuce. He challenged the out call on his second serve, however, and the call was overturned, allowing him to again regain the tempo.
After hitting a forehand crosscourt winner on his second match point, his celebrations were delayed when Nadal challenged the call. Federer watched the replay, and leaped for joy when it showed his last shot was in. His 100th match at the Australian Open ended with his fifth title at Melbourne Park.