The Spanish second seed was two sets and a break up when Russian Medvedev launched an incredible comeback, winning over a previously hostile crowd in the process.
There was a shock in the women's final as Canadian teenager Bianca Andreescu denied Serena Williams a record-equalling 24th grand slam title.
Here, PA looks back at the 2019 US Open.
Match of the tournament
The award has to go to the final match of the fortnight, a breathtaking encounter between Nadal and Medvedev which had simply everything over four hours and 50 nerve-shredding minutes.
Shot of the tournament
— US Open Tennis (@usopen) August 30, 2019
An honourable mention to Monfils for his extravagant smash on match point against Marius Copil.
But Nadal's round-the-corner cracker to set up match point against Marin Cilic defied belief.
Moment of the tournament
We all had something in our eye when Naomi Osaka consoled a tearful Coco Gauff at the net following their third-round match.
Shock of the tournament
Grigor Dimitrov had not beaten Roger Federer in his seven previous attempts, was ranked a lowly 78 and in terrible form, so not many saw his five-set win coming.
Break-out star of the tournament
Teenage kicks in the women's final as 19-year-old Bianca Andreescu, playing in her first grand slam final, shocked six-time champion Serena Williams.
Quote of the tournament
Reconciliation of the tournament
Johanna Konta's fine form at grand slams continued with a third straight quarter-final appearance, where Elina Svitolina ended her run. Dan Evans was schooled by Roger Federer in round three, while Kyle Edmund, Cameron Norrie and Harriet Dart all fell at the first hurdle. Jamie Murray retained his mixed doubles title with Bethanie Mattek-Sands and there was wheelchair success for Alfie Hewett, Gordon Reid and Andy Lapthorne.