Fergal O'Brien has qualified for the World Championships at the Crucible after clinching the longest frame in the history of snooker to edge out David Gilbert 10-9.

Ireland's O'Brien, 45, showed remarkable resolve to edge home at Ponds Forge International Sports Centre in Sheffield -- claiming a final frame that lasted a record-breaking two hours, three minutes and 41 seconds.

Having made the main draw for the first time since 2010 and earned a first-round clash with defending champion Mark Selby, O'Brien said: "Obviously in an ideal world you win a bit quicker than that.

"The balls went scrappy in the colours and I was so tired, double-checking everything and I'm so, so relieved. I'm looking forward to the draw now."

The previous record for the longest ever frame in professional snooker was one hour, 40 minutes and 24 seconds -- set by Alan McManus and Barry Pinches at the 2015 Ruhr Open.

Another man through to play at the Crucible is 2002 champion Peter Ebdon, who was taken to the wire by Michael Holt before progressing 10-9.

Ebdon said: "The one positive coming out of this week was that I've felt more like the old me: I was really determined and very focused.

"If I turn up and play then I've got every chance. I've certainly found some resolve from somewhere, some determination to succeed again and get back to the Crucible."