Philipp Kohlschreiber overcame American John Isner 6-4 3-6 4-6 6-3 6-4 in a match that equalled the latest finish at the US Open.
The official completion time of 2.26am was the same as a second-round match in 1993, when Mats Wilander beat fellow Swede Mikael Pernfors.
Winning his six consecutive five-setter, Kohlschreiber concluded a poor Grand Slam season for the top-ranked American who has failed to make it past the third round at any of the four major tournaments.
The latest loss saw Isner hit 22 aces but drop his serve on each of the three break points he faced, and end the match in a sour mood.
He got upset over a miscommunication when chair umpire Carlos Bernardes charged him for an instant-replay challenge that Isner said he didn't really want at the start of the fifth set.
After pushing a forehand long on the next point, Isner whacked a ball in anger into the stands, drawing a warning for unsporstsmanlike conduct.
A foot-fault call added to Isner's ire and when he sat down in his changeover chair he pounded his racket to the court twice, busting up the frame then chucking it away. Because of the earlier warning, Bernardes charged Isner with a point penalty, so Kohlschreiber started the next game ahead 15-love.
Isner got a break chance while down 4-3 but he sent a groundstroke long, and Kohlschreiber wound up holding to lead 5-3. Two games later, the match was over.
The German's reward is a date with eighth seed Janko Tipsarevic.