The Spanish legend won his first title in Melbourne since 2009 with the 2-6 6-7 (5-7) 6-4 6-4 7-5 victory in five hours and 28 minutes of sublime tennis on Rod Laver Arena on Sunday night.
He surges past Roger Federer and Novak Djokovic in number of major titles.
Nadal was comprehensively outplayed by Medvedev in the first set but started to find his groove in the second.
In a second set marred by a protester who was dragged from the court by security, he had a 4-1 lead in the second set but lost serve in the seventh game.
He broke back immediately, but was himself broken in the subsequent game at 5-4 despite having a set point before Medvedev took the set to a tiebreak.
The tiebreak was an even affair as neither player could get breathing space, until world No.2 Medvedev won the final four points to win 7-5 and take a two-set lead.
The 35-year-old Nadal refused to give up, saving three break points to even the third set at 3-3 and then breaking Medvedev at 5-4 to win the set.
Medvedev began to show signs of physical and mental fatigue, needing physio treatment to his thigh and repeatedly taking aim at the boisterous pro-Nadal Melbourne crowd.
Speaking to chair umpire John Blom, he labelled spectators “idiots” with “empty brains” whose “lives must be very bad”.
“Can you step up? Can you take control, please? Step up please,” he said to Blom in complaining about crowd members yelling during points and after faults.
“It’s the final of a grand slam. Step up.
“Please is not enough. They’re idiots. Please doesn’t work”
While both players showed signs of exhaustion, having played numerous four and five-setters throughout tournament, the standard of tennis barely dropped in the fourth.
Each had chances to go ahead, and they traded breaks early in the set before Nadal took a decisive lead by clinching the seventh break point of the fifth game.
In the fifth set, both players looked like heavyweight boxers in the 12th round of a championship bout, as they kept throwing punches.
It was Nadal who took the crucial break to lead 3-2 then saved three break points in the following game to gain a buffer.
Medvedev tried hard and eventually levelled at 5-5, appearing to have gained a burst of late energy.
But Nadal, who did not know if he would play tennis again after suffering a serious foot injury then contracting COVID-19 last year, broke back immediately then held strong in the following game.
“Daniil, you are an amazing champion. I have been in this position a couple of times in this tournament, having chances to have the trophy with me, but I don’t have any doubt that you will have this trophy a couple of times in your career because you are amazing,” Nadal said.
“So I want to congratulate you and all of your team and family for everything.
“It has been one of the most emotional matches of my tennis career and to share the court with you is just an honour. So all of the best in the future.
“It is just amazing. A month-and-a-half ago I didn’t know if I would be back on the tour playing tennis again and today I am here in front of all of you having this trophy with me and you don’t know how much I fought to be here.
“I can’t thank you all enough for the support I received since I arrived here. You are just amazing. Thank you for the love and the support.”
It’s his first grand slam victory since the 2020 French Open.
The sapping encounter was the second-longest final in Open history, behind only Nadal’s five-hour, 53-minute loss to Djokovic in 2012.
Nadal joins Rod Laver, Roy Emerson and Djokovic as only the fourth man in tennis history to win each of the four grand slam titles at least twice.
– With AAP