Australian wildcard Thanasi Kokkinakis has been knocked out of the ATP 250 event in Los Cabos, Mexico by Denis Kudla after a three-set epic.
The American came from a set down to win 4-6 7-6 (7-4) 7-6 (7-3) in three hours 11 minutes, with the contest ending at 1.16am local time on Tuesday.
World No.107 Kudla, who was outplayed for large parts of their second ATP meeting, twice came within two points of losing to 2017 finalist Kokkinakis, who struck 23 aces.
But a strong performance in the deciding set tiebreak helped the 28-year-old to just his fifth victory of the year.
Kudla, who was beaten by Novak Djokovic in the Wimbledon third round, will next face a fellow American - either eighth seed Mackenzie McDonald or qualifier Ernesto Escobedo.
Earlier, another Australian in Alex Bolt advanced to the round of 16 with a come-from-behind win over seventh-seeded Andreas Seppi.
Bolt recovered from losing the first seven games of the match to record a 0-6 6-2 6-3 victory in one hour 38 minutes.
The world No.148 lost the opening set in just 24 minutes, but the South Australian won seven of the next eight games to level the match at a set apiece and then take the lead for the first time.
Bolt broke the 37-year-old Italian in the sixth game of the final set and served it out on his first match point.
The 28-year-old will meet either Emilio Gomez or qualifier Nicolas Mejia, who are both ranked below him, in the next round.