WATCH Nadal on the ATP Tour LIVE on beIN SPORTS in 2022 | Foxtel, Kayo Sports, Fetch TV, beIN SPORTS CONNECT
The 35 year-old Spaniard won 2-6 6-7 (5-7) 6-4 6-4 7-5 in five hours and 24 minutes on Rod Laver Arena, snatching victory in a match that looked Medvedev's for the taking after two sets.
In the process, Nadal went past great rivals Roger Federer and Novak Djokovic on the all-time list of men's singles grand slam winners, just months after a foot injury left him with doubts over his future in tennis.
For Medvedev this was a second successive Australian Open final defeat, having lost to Djokovic 12 months ago, and his frustration was apparent over his failure to close out the match from two sets in front.
This was Nadal's second Australian Open title and first since 2009, when he beat Federer in another five-set tussle. At the end of this match, as Nadal celebrated, the great Laver himself was captured on television footage taking a photograph of the scene.
It was 01:32 on Monday morning in Melbourne when Nadal got his hands on the trophy, and as he addressed the crowd, he began: "Good evening everybody. Well, good morning at least."
Nadal had sympathy for Medvedev, describing the Russian as "an amazing champion". Reflecting on his own disappointments in Melbourne, where he has lost four finals, Nadal said: "I don't have any doubt you'll have this trophy a couple of times in your career because you're amazing."
Roared on by thousands of witnesses to history, Nadal told Medvedev: "It has been one of the most emotional matches of my tennis career, and to share this court with you is just an honour."
There were no tears from Nadal. He was briefly stumped for words to recognise his achievement, saying: "I even don't know what to say, guys.
"For me, it's just amazing. One month and a half ago I didn't know if I would be able to be back on the tour playing tennis again, and today I'm in front of you having this trophy with me.
"You really don't know how much I've fought to be here. Thank you so much for the love and the support. Without a doubt I am having probably one of the most emotional moments in my tennis career."
Nadal lost a five hours and 53 minutes epic against Djokovic in the 2012 Australian Open final. That remains the longest grand slam final in history, but this pushed it close.
The champion said the support he was shown in Melbourne would "stay in my heart for the rest of my life", before pointing again to his battle to get fit after the foot problem that forced him to abandon his 2021 season in August.
"One month and a half ago, I would have said maybe there is a chance that's going to be my last Australian Open," Nadal said. "But now that's plenty of energy to keep going, so thank you very much.
"I really can't explain the feelings I have right now, but I'm going to try my best to keep coming next year."
A humdinger of a final saw Medvedev force a two-set lead, only for Nadal to dramatically level the match, the 35-year-old rolling back the years.
Nadal broke early in the decider to lead 3-2 and then withstood fierce pressure from Medvedev in the next game.
It was astonishing that the Spaniard was outmanoeuvring a man 10 years his junior, and a player who beat Djokovic in straight sets in last year's US Open final.
At 5-4, Nadal had a service game to cross the winning line. Federer missed a chance to reach 21 slams when he could not take two championship points against Novak Djokovic in the 2019 Wimbledon final, and this was a similar opportunity for Nadal.
At 30-15, he served a double fault, and Medvedev pounced on his chance, winning the next point after a fizzing forehand and smash, and the next when Nadal netted. The decider was back on serve, but Nadal was not finished, engineering three break points in the next game and jumping on the third of those, Medvedev hoisting a forehand long.
This time Nadal was not to be denied. When Medvedev could not scoop back a backhand volley, the title was Nadal's, and the broadest of smiles crossed his face.
Medvedev said defeat was "tough to take", but he added: "I want to congratulate Rafa because what he did today, I was amazed.
"I tried just to play tennis, but after the match I asked him, 'Are you tired?'.
"It was insane. I think the level was very high. You raised your level after two sets for the 21st grand slam. I thought he was going to get tried, and maybe you did just a little bit, but you're an amazing champion."
Looking at the race between Nadal, Djokovic and Federer to finish with the most slams, Medvedev said: "I think you guys have a good rivalry still. It's not over yet, but congrats."
Both men thanked tournament director Craig Tiley, who was close to the centre of the pre-tournament storm that saw Djokovic deported from Australia.
And Medvedev spared a thought for wife Daria, watching from home.
"Usually there's my wife in the [players'] box," he said, "but I think probably the TV's broken right now."