The Swiss maestro served for the set, and the title, but del Potro dug deep to save three match points, two at 40-15 down, before breaking back to send the stanza to a tiebreak, which the Argentine dominated.
Croft was left in amazement by Del Potro's lethal forehand which eventually wore the world No 1 down as he rallied from three match points down in the third set to record a sensational victory.
After slipping outside the world's top 400, Del Potro returned to the top five in 2013 but another wrist injury meant more surgery and led him to miss the majority of the 2014 and 2015 season.
The injury-prone big man has beaten Federer in seven of 25 attempts, including a famous triumph in the 2009 US Open final, but he has found it hard to reach those levels in recent years due to troubles with his body.
A Federer drop shot, expertly chased down by Del Potro, was followed by a lob and then a hotdog from the Argentine, before two more volleys from the 36-year-old brought an end to a sublime point and brought the crowd to its feet.
Federer survived a match point in the second set tiebreaker to force the third set. Federer mishit a forehand high into the air beyond the baseline, giving del Potro another break point. However, Federer pounced with his best return game of the match to break for 5-4.
He has regained form over the last two seasons but, although he entered the final on a 10-match winning streak after clinching victory in Acapulco for his 21st singles crown last month, he was still the underdog against Federer.
Ireland make one change for grand slam decider
The back-line may not have as much experience as the pack, but they are exceptionally frightening for opposition defences. In terms of results we have, but in terms of where we want to go as a team, we are moving forward.
"I have everything that I want, and I want to keep improving my game to see what can I do", he said.
"It was an unbelievable match in all the ways", del Potro said of Sunday's duel. It was his first win against Federer since last year's US Open quarters.
Osaka, 20, won the first title of her career at the expense of her friend, fellow 20-year-old Daria "Dasha" Kasatkina, 6-3, 6-2.
"I was surprised how long it took him to get more and more confident coming over, but I feel like he's finally there".
"It was a great match, honestly", Federer said. While Federer struggled mightily to find the court with the match on the line, Del Potro was finding another level.
The crowd were off their seats when Federer produced a brilliant victor at full stretch in the first game of the second set and rose again when he won an epic rally which Del Potro kept alive with a between-the-legs shot from the baseline. I am just enjoying my life and playing around the world. (Having said that), Juan Martin well played today. I mean, we played a great level of tennis.
"Not much in between us, but you deserve it", the Swiss told del Potro at the trophy ceremony.
Welcome to Spring snow storm targets New York City
The system is still far enough out that models are still highly uncertain of the exact location of the storm, Varian said. Forecasters say a late winter storm is expected to bring significant snowfall to parts of West Virginia this week.
What we know about the Miami bridge collapse
The pedestrian bridge, which was recently installed on March 10, collapsed down during the busy rush hours at Miami on Thursday. The National Transportation Safety Board said on Twitter that it was sending a team to investigate the bridge collapse.
A preview of Thursday's NCAA Tournament games
But since Sexton returned a week later, Petty has eclipsed double digits in scoring just six times, including the last two games. Here are all of the details for today's game including matchup odds, start time , TV channel , and how to watch the Alabama vs.