Anthony McGill battled back from the brink of defeat to beat fellow qualifier Jamie Clarke in a dramatic post-midnight finish on day ten of the World Snooker Championship at the Crucible Theatre in Sheffield.
A hard-fought contest resumed at 8-7 going into the final session, with session two of the contest ended a frame early because of the lengthy nature of the contest.
This continued during a dramatic final session which featured several lengthy frames featuring bouts of safety and missed pots, as the tension of the situation took hold for the two Crucible debutants.
Scot McGill eventually prevailed 13-12 in a match that lasted more than ten and a half hours and finished at ten minutes past midnight local time.
He will now face fellow qualifier, Kurt Maflin of Norway, in the last eight after coming back from the brink of defeat against Welshman Clarke.
Clarke led 12-11 and was on course to complete victory but after a missed pot McGill cleared up to the black.
After a safety exchange on the final ball, McGill potted the black to force a decider.
After both players had chances the decider came down to another long safety exchange on the final red.
Clarke then committed a foul by hitting the yellow first when trying to clip the red and left a free ball, enabling McGill to pot a colour in place of the red and subsequently clear up to the pink to seal a dramatic win.
Elsewhere England's Kyren Wilson, who received a first-round bye after his opponent withdrew, overcame Martin Gould 13-9 to reach the quarter-finals.
Wilson, who led 11-5 going into the final session, was largely a spectator in the early stages of the session as Gould won three frames on the bounce to reduce the deficit to 11-8.
Frame 20 proved a turning point as Wilson clinched it from 68-0 behind by claiming the three snookers he required and then making a break of 41 to clear up, putting himself one frame away from victory.
Gould took the next before Wilson took frame 22 with a break of 79 to secure the win.
He will face defending champion Judd Trump in the last eight.
Australia's Neil Robertson, the second seed, also reached the quarter-finals today after a 13-9 win over England's Barry Hawkins.
Resuming at 8-8 going into the final session, the Australian ended up winning with a degree of comfort by 13 frames to nine.
Robertson won the first three frames of the session to go 11-8 up, before Hawkins made a century to reduce the deficit to two frames.
Robertson won the next two to seal victory and a last eight berth against England's Mark Selby, in what will be a battle of two former world champions.
England's Ronnie O'Sullivan also reached the last eight after a 13-10 victory over China's Ding Junhui.
A rapid-fire contest continued at the same pace of the opening two sessions as it resumed evenly poised at 8-8.
O'Sullivan won the first two frames of the session to go 10-8 up, before Ding pulled one back.
Ding had a chance to level but after missing a red O'Sullivan cleared up to restore his two frame lead.
Ding then won the next to stay hot on O'Sullivan's heels, however the Englishman won the next two frames with breaks of 117 and 93 to secure the win and a quarter-final against fellow multiple world champion Mark Williams.
The seven frames in the final session between O'Sullivan and Ding were completed in a total of 67 minutes, while the corresponding match on the other table between McGill and Clarke was only in the third frame of its session.