Federer got on top early, then Nadal hit back by winning the second set. The Swiss looked like he was imploding at the start of the third, then stormed home to win it 6-1 before the Spaniard, as much machine as he is human, hauled him back in to clinch the fourth.
The fifth set was the longest of the match, lasting over an hour. Nadal broke early but something inside Federer clicked and he started swinging with more abandon than he had done all match.
Winners were interspersed with plenty of unforced errors, but he didn't care. If he was going to add another chapter to one of the most awe-inspiring legacies in tennis, he was going to do it his way.
Federer's aggression paid off and shortly before midnight on Sunday, he was holding yet another trophy above his head on Rod Laver Arena.
Here's the reaction to one of the greatest grand slam stories in tennis history.
TWO WORDS HAVE THE TENNIS WORLD IN A SPIN
"I hope to see you next year, but if not, this was a wonderful run here and I can't be more happy to have won tonight."
With that single sentence, Roger Federer sent tennis brains everywhere spinning into psychologist mode. "If not"? Care to explain, Roger?
Was Federer hinting at retirement? Was he trying to tell us Sunday night may have been the last time we see him at Melbourne Park? Or was it just something that slipped out amid a flurry of emotions?
Whatever it was, the tennis world was intrigued.
Perhaps tour veteran Juan Martin del Potro picked up on something in that statement too. If he did, he wanted the 18-time grand slam champion to quickly change his tune.
Four-time grand slam champion and Channel Seven commentator Jim Courier wasn't about to jump behind any wild theories, taking the Fed Express's quote in a different manner.
"I'm going to interpret that as, 'If this is my last major win'. Roger Federer loves the game, loves the life. It would be hard to believe he would be going anywhere any time soon. This is not a Pete Sampras, one more major and walking off the stage moment," Courier said, referring to Sampras's retirement which occurred after not playing a single match following his 2002 US Open win over Andre Agassi.
"He is guy who has carried the weight of being Roger Federer as if it is a feather. This is a guy who is expected to win for so many years and that kind of stress is, it can be a lot on a player, but he's always just carried it like it was natural for him, like just a normal thing.
"I assure you, it is not normal. There is very little about Roger Federer that is normal."
THE CHAMPION
Neither Federer nor Nadal were supposed to be on court on January 29.
Their ageing bodies should have let them down. The fact they'd hardly been able to play in 2016 should have meant they were rusty and unable to keep up with younger, more battle-hardened opponents.
Federer admitted as much in the post-match presentation.
"I'm out of words ... I'd like to thank Rafa on an amazing comeback," Federer said. "I don't think either one of us thought we were going to be in the finals in Australia when we saw each other at his academy five months ago.
"I would have been happy to lose to be honest, the comeback was perfect as it was. There are no draws in tennis but if there was I would have been happy to draw and share it with Rafa, really."
Yes, the comeback was perfect. Not just in terms of the end result, but because that result came against the Swiss' greatest rival.
The world No. 17 was aiming low before the start of the year's first grand slam, but as he progressed - winning three five-setters in a major for the first time in his career (including earlier wins over Kei Nishikori and Stan Wawrinka) - the motivation to achieve something he will never forget drove him forward.
In a career full of highlights, a "milestone" is how the fan favourite described this particular triumph.
"I would have said a great event would be quarters, you know. I said fourth round would be nice, quarters, great," Federer said. "I went so much further than I thought I would. Today I just drove myself forward.
"It is all worth it. You don't know if they ever come back, these moments. That is what you work hard for. You work for the stress and you work for it to go away and you work for it for maybe a country, for Switzerland, maybe for your team, for your family, for whatever it is.
"It's a milestone in my career. This one means a lot to me because he (Nadal) has caused me the most problems over the years. So to get one over him in the fifth set is incredible, absolutely and feels super special.
"Of course there's stress that goes away and it is just emptiness and this beautiful moment. I couldn't be happier right now.
"I can't believe I'm sitting here and doing all this. It's incredible, it really is."
THE DEFEATED
He's won one Australian Open, but it's clear Rafael Nadal wants more. As ever, there was a sincerity and class all athletes can learn from in his post-match address, and even after an injury-ravaged 2016, it seems we can expect to see a lot more of the 30-year-old.
"Just amazing the way that he (Federer) is playing after such a long time without being on the Tour ... for sure you have been working a lot so congrats, I feel very happy for you," Nadal said on the dais.
"Probably Roger deserved it a little bit more than me, so I'm just going to keep trying.
"That is the third time I have this (runner-up trophy), it is beautiful but the (winner's) trophy is still much better. I'm going to keep trying hard to have that trophy with me again in the future."
Much like the 2009 Australian Open final between the same two players (won by Nadal), Sunday night seemed destined to go the distance. What started as a tennis lover's dream became reality, but the Spaniard found it hard to reflect so soon after the match on just where this contest ranked in the library full of Federer-Nadal battles.
"I don't know now. I just feel that has been a good match, five-set match, in a very special final for the fans and for us," Nadal said. "It's great to play against him again after couple of years without making that happen in a big final.
"But that's it. I cannot rank this final now."
Yes, he would have loved to have beaten Federer, obviously. But just as the champion said he would have happily lost or taken a draw, so satisfied already was he with his tennis comeback, so too was Nadal thrilled to be back on the court again.
That's what pleases him most. It's a simple pleasure, but it's all Nadal wants.
"I won great matches against great players. I competed well against everybody. That's the most important thing for me. That makes me feel happy," Nadal said.
"Of course, winning an event like this is so important. For me, if I won that one, will be amazing. But the real thing is what makes me more happy, more than the titles, is to go on the court and feel that I can enjoy the sport.
"Today I am enjoying the sport. Last year I only had the chance to enjoy the sport between Indian Wells and Madrid, because in Madrid I got an injury in quarter-finals. That's the real feeling.
"At this moment in my career, more than titles, for sure if I am playing here, I believe that I am going to win titles. More than all these kind of things is being healthy enough to work the way I need to work, to fight for the things I want to fight.
"I'm going to keep trying to do and to work the same way."
TIME TO APPRECIATE
It would take a brave man or woman to deny Federer is now the sport's greatest ever player.
It's a debate that will rage long after this weekend and well after the Swiss retires, and it's a question that will probably never be answered. So while many may be on Federer's side when that argument arises, now is probably a time to admire the spectacle we saw on Sunday night, and to appreciate how lucky we are to have the privilege of watching two legends of the sport.