Only Federer, Pete Sampras and Jimmy Connors, with five titles each, have reigned more times than Nadal in New York in the 51-year open era.
The great Spaniard's four hour and 49 minute victory extended the dominance of tennis's big three of Nadal, Federer and Novak Djokovic to 12 straight slams.
But Nadal was forced to fight to prevent Medvedev from striking a massive blow for the sport's next-gen stars.
Medvedev was striving to become the first man in his 20s to claim a singles slam since Andy Murray won his second Wimbledon title in 2016.
Riding a wave of confidence after four consecutive hardcourt finals over the American summer, 23-year-old Medvedev threatened to pull off a nigh-on impossible comeback win over the mighty Majorcan after taking the third and fourth sets.
Nadal had won more than 200 matches for just one defeat after establishing two-set leads during his glittering career.
Full match replay
Medvedev, 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.
Even after dropping four successive games to trail 5-2 in the tense deciding set, Medvedev wasn't done.
Rattled by another time sanction from American official Ali Nili, Nadal double-faulted on break point to offer Medvedev a lifeline.
Alas the world No.2 proved an immovable object against the irresistible force, finally prevailing on his third match point to add another US Open trophy to go with his titles in 2010, 2013 and 2017.
Nadal's 19th major leaves the 33-year-old in position to catch Federer at the Australian Open in January.
At one point, after he won the fourth of his five titles in New York in 2007, Federer was nine slams clear of Nadal.
Federer still had four more majors than Nadal as recent as after winning his 20th at last year's Australian Open.
But in accruing his 11th and 12th French Open titles in 2018 and 2019 - to go with twin successes at Wimbledon in 2008 and 2010, a 2009 Australian triumph - and saluting again at Flushing Meadows, the Spaniard is suddenly within striking distance of joining Federer as the most successful performer in men's grand slam history.