Roger Federer won his 18th Grand Slam title and first for five years with a thrilling five-set victory over Rafael Nadal in the Australian Open final.
The 35-year-old Swiss won 6-4 3-6 6-1 3-6 6-3 to claim his fifth Melbourne title and extend his lead at the top of the all-time men's major winners' list.
Nadal, 30, remains tied in second with Pete Sampras on 14 Grand Slams following his first final since 2014.
Federer's previous major title came at Wimbledon in 2012.
"I've been coming here for almost 20 years now," said the Swiss. "I've always enjoyed it and now my family does too.
"Thanks again for everything, to everybody. I hope to see you next year. If not, this was a wonderful run here and I can't be more happy to win tonight."
His achievement in ending that drought is all the more remarkable given this was his first tournament since Wimbledon last July, after which he took the second half of the season off to recover from a knee injury.
Federer becomes the first man in history to win five or more titles at three different Grand Slam events - five Australian Opens, five US Opens, seven Wimbledons.
Nadal was also on the way back from injuries that curtailed his 2016 season, but the Spaniard could not improve his winning record against Federer - the Swiss has now won 12 of their 35 matches and three of nine major finals.
"I worked very hard to get where I am today," said Nadal. "I fight a lot, probably Roger deserved it a little bit more than me today.
"I'm just going to keep trying. I feel I am back at a very high level."
The return of one of the great tennis rivalries to the Grand Slam final stage led to huge anticipation for the final, and it lived up to the billing over three hours and 37 minutes.
A match of wild momentum swings ended with a purple patch from Federer that saw him win the last five games, and clinch the title thanks to confirmation from a Hawkeye challenge.
Federer leapt in the air in celebration and, after consoling close friend Nadal, broke down in tears as his wife Mirka and team celebrated in the stands.
"Tennis is a tough sport," said Federer. "There are no draws. If there were I would have been happy to accept one tonight and share it with Rafa.
"Everybody says they work very hard - I do the same - but I try not to shout about it. I'd like to thank my team. It's been a different last six months. I didn't think I'd make it but here I am."
Federer finishes with a flourish
There were moments of genius from both players - a stunning forehand angled winner from Nadal as he dominated the fourth set, a breathtaking 26-stroke rally in the fifth that ended with a crushing Federer forehand - but in the end the attacking instincts of Federer held sway.
He dropped just four points on serve in the first set, breaking serve after a brilliant drive volley in game seven, only for Nadal to race 4-0 clear in the second.
Federer recovered one of the breaks but it was not enough as Nadal served out to love to level the match, and then heaped on the pressure early in the third.
With the momentum slipping away, Federer came up with three aces on break points to nudge ahead in the first game - and it proved to be a decisive moment.
A magical half-volley forehand helped Federer get the break in the next game and he rolled through the set for the loss of just one game.
Neither had been able to produce their very best consistently and it was Federer's turn to leak forehand errors as he fell behind in the fourth set, and Nadal appeared the stronger as they headed into a decider.
Federer needed an off-court medical time-out, just as he had before the fifth set of his semi-final against Stan Wawrinka, and he had treatment to his thigh on the changeover as he fell 3-1 behind.
Despite his physical issues, Federer continued to press on the Nadal serve, earning break points in each game until he finally converted a sixth to level at 3-3.
The Rod Laver Arena crowd roared as the Swiss swept through a service game and then broke again in a dramatic game, winning a 26-stroke rally that will rank among the best ever.
Closing out a Grand Slam final was never going to be easy after five years, and Federer had to recover from 15-40 before firing a forehand onto the line and waiting for Hawkeye to confirm it was a historic winner.