Adrian Mannarino stumbled across the winning line at 02:33 local time as his late-night efforts at the Australian Open proved too much for last year's surprise package Aslan Karatsev.
A battling third-round performance from Frenchman Mannarino sets up a showdown with Rafael Nadal next, and the 33-year-old will hope he has sufficient energy left for that daunting task.
The left-hander clinched victory after four hours and 38 minutes of hard duelling with Karatsev on Margaret Court Arena, with a scattering of fans staying until the bitter end, long enough to hear Mannarino swear during his victory interview.
The watershed in Melbourne had of course long passed by the time Karatsev netted a backhand on match point.
After his 7-6 (7-4) 6-7 (4-7) 7-5 6-4 win, world number 69 Mannarino said: "I was enjoying it, you know. I love rallying, and I was just feeling in shape today, it was pretty cool to play."
But he was aware the match was running well into the early hours, saying: "I realised I was just looking at the clock sometimes, and I was thinking, 'F***'. I don't feel good to be honest'.
"I'm kind of exhausted. But it was cool, and I was so focused on what I had to do. I was not thinking about the fact I was tired.
"I was like, 'Okay, go get the next point'. The crowd was cool. Some people had a couple of drinks, I guess, and were commentating more than anybody."
Mannarino's win took him into the fourth round in Australia for the first time, and it meant he accounted for the 18th seed, a player who won the Sydney Classic last Saturday.
Karatsev reached the semi-finals at Melbourne Park last year as a virtual unknown, before going on to establish himself over the course of the season.
Remarkably, this Friday night into Saturday morning epic was far from the latest finish in Australian Open history, with Lleyton Hewitt having won a five-setter against Marcos Baghdatis at 04:34 local time in 2008.