Ireland's Fergal O'Brien won the longest frame in professional snooker history to take the final place at the World Championship in Sheffield.
He beat David Gilbert 10-9 with the deciding frame lasting two hours, three minutes and 41 seconds - 44 seconds longer than the men's marathon world record in athletics.
Peter Ebdon also narrowly qualified but two-time winner Mark Williams is out.
The championship starts on 15 April with the draw on Thursday at 10:00 BST.
The frame between O'Brien and England's Gilbert comfortably beat the previous pro record of one hour, 40 minutes and 24 seconds, set by Alan McManus and Barry Pinches at the 2015 Ruhr Open.
"Obviously in an ideal world you win a bit quicker than that," O'Brien said.
"The balls went scrappy in the colours and I was so tired, double-checking everything and I'm so, so relieved."
Elsewhere in qualifying, former world champion Ebdon beat Michael Holt 10-9 on the final black to qualify for his 24th World Championship.
Meanwhile, two-time winner Williams lost to Stuart Carrington.
Wales' Williams, champion in 2000 and 2003, trailed his English opponent 6-3 going into the final session and was eventually beaten 10-7.
Graeme Dott, the 2006 world champion, recovered from 4-0 down to beat Jamie Jones of Wales 10-8, while fellow Scot Stephen Maguire defeated China's Li Hang 10-5.