Nadal's victory moves him within one of Swiss rival Roger Federer's all-time leading tally of Grand Slam victories. But he had to save a break point in the last game before converting his third match point.
Nadal had won more than 200 matches for just one defeat after establishing two- set leads during his glittering career.
Those struggles receded further into distant memories this year as he reached the semi-finals at all four majors for the first time since 2008, his five-set win over Medvedev moving him a step closer to history.
The Muscovite, though, had Nadal on the ropes - and feuding with the chair umpire in frustration after receiving a series of time violations for exceeding the 25-second limit between points - early in the fifth set.
Throughout the rest of that match he was booed and jeered by tennis fans in attendance, a reaction which inspired a stunning comeback and a sarcastic thank you from Medvedev post-match.
Nadal has won two of the four slams this term - the United States and the French - equalling Novak Djokovic who won the other two.
But he kept swinging, somehow breaking back to level, and with the crowd now firmly behind their new darling, he repeated the dose at 6-5 to take it to a fourth set with Nadal now the man looking vulnerable.
Nadal sees little to take from a windy Montreal win given the likely lack of breezes in the big stadium.
"I give myself another chance, as I did in Wimbledon, as I did in Australia, as I did in Roland Garros".
Not since 1949 has anyone won a U.S. Open final after trailing by two sets to none.
Nadal, who warned the Big Three era is nearing an end, believes the time will soon come for Medvedev.
Already the King of Clay, the Spaniard has been a master of the Flushing Meadows hardcourts this NY fortnight but had to dig mighty deep to beat the Russian 7-5 6-3 5-7 4-6 6-4 on Sunday (local time).
The 33-year-old Spanish left-hander moved one shy of Roger Federer's all-time men's record 20 Grand Slam triumphs and became the second-oldest NY champion in the Open era after Ken Rosewall in 1970 at age 35.
Nadal leads 7-5, 6-3 and has lost only once at the Open when he won the first two sets.
"I feel honoured to be part of this battle [with Federer and Djokovic]".
Daniil Medvedev once reveled in his role as the villain of Flushing Meadows but on Sunday the Russian completed his transformation to unlikely hero after taking Rafael Nadal the distance in a pulsating U.S. Open final.
The 4-hour, 50-minute triumph was Nadal's fourth championship at Flushing Meadows, where his passion and intensity have long made him a fan favorite.
Medvedev was playing in his first Grand Slam final.
Meanwhile, Elise Mertens and Aryna Sabalenka won the women's doubles championship.
- Prince Harry Just Broke His Silence About That Private Jet Controversy
- Track, computer models, radar for Hurricane Dorian
- Duke and Duchess of Sussex skip Queen's traditional Balmoral summer holiday
- Serena Williams rolls into semifinals with 100th US Open win
- Second US death linked to vaping is reported in Oregon
- Australia Bank on Smith to Register Win
- Florida tourism feels impact of hurricane
- Cocaine washes up on Florida beach as Hurricane Dorian approaches
- Brexit snap election might plumb further chaos
- Ranking for Third Year in a Row