The 2001 champion defeated the 2009 winner, 6-4, 5-7, 3-6, 7-6 (7/2), 6-1 in the tournament's biggest shock to date.
Hewitt, 32 years old and down at 66 in the rankings after a lengthy battle with injuries, served up a trademark warrior-like performance that recalled his golden days when he was world number one and Wimbledon champion.
It was his 32nd career five-set victory and gave him a third round match-up with Russia's Evgeny Donskoy, the world number 102.
"I don't know how many years I have left to play and I was hankering to get out on this court again and put on a show."
Del Potro, still bothered by a wrist injury, was beaten in his second successive four-hour match.
"He's a great champion and a great fighter," said the big Argentine.
Hewitt, playing in his 13th US Open after having made his debut in 1999, hit 42 winners, one more than del Potro, who committed 70 unforced errors, a bleak statistic which eased the impact of the Australian only converting eight of 18 break point chances.
