James Cahill, a 23-year-old amateur who was chalked up as a 500-1 outsider for the world championship, has admitted he “could barely stand up”, owing to nerves at the end of his staggering 10-8 victory over the world No 1, Ronnie O’Sullivan.

Few had given Cahill, who does not have a world ranking and had to battle through three qualifying matches to reach the first round, a sliver of a chance against O’Sullivan, who was trying for his sixth world title. However he held off the jitters and a late fightback to seal one of the biggest shocks in Crucible history.

A strangely listless O’Sullivan blamed his defeat on a virus which he claimed had robbed him of his energy and his mojo. “All my limbs feel heavy,” he said. “I feel absolutely shattered, drained, no energy, struggling to stay awake. I feel absolutely horrendous. You have to come here physically and mentally feeling good. I’ve had a good season. I didn’t expect to do well and if physically not 100% it makes it harder. I tried to see what I could do to get through this match.”

O’Sullivan, who was a 1-50 favourite beforehand, also paid tribute to his young opponent, adding: “He’s come here and played brilliantly. Fair play to him. But I kind of left him pretty easy chances and the lad gained some confidence. You have to give credit to him.”

Cahill had started the day’s play with a 5-4 lead and quickly took advantage of a series of uncharacteristically poor shots to move 8-5 ahead at the interval. At this stage O’Sullivan was frequently scratching his head, wondering like his supporters where his best form was hiding. Breaks of 108 and 89 helped level the match and he looked set to go ahead in the 17th frame only to miss a simple pink off its spot, allowing Cahill to move within one frame of victory.

In the next frame O’Sullivan again looked in control only to inadvertently knock in a red while cannoning into the pack. It still left Cahill with plenty to do to win the frame. Yet he belied his inexperience and the enormity of the occasion to make a match-winning clearance.

After potting a pink to seal the victory he pumped his fist in triumph and shouted “Come on!”. The Crucible crowd, which was strongly behind O’Sullivan, responded with polite if muted applause.

James Cahill was ranked as a 500-1 outsider for this year’s world snooker championships. Photograph: Xinhua/Rex/Shutterstock

“That’s the best win of my career by far,” Cahill said. “And to do it here on my Crucible debut against Ronnie, I don’t think there is much better than that. You don’t expect him to miss so many balls. When he starts missing a few, you think I’ve got a chance here. I tried to be professional, commit to my own game and not get too carried away.”

Cahill, whose victory was the first by an amateur in the history of the world championship, was not quite sure how he managed to hold his nerve in the final stages. “I could barely stand up at the end,” he said. “I just tried to keep my eyes on the table and just play the shots as they come. I have quite a good temperament for that sort of thing but in that circumstance it is not easy to hold yourself together. I am just glad I could.”

It was a victory years in the making. Cahill comes from a snooker background. His mother, Maria, was a leading female player in the 80s and 90s, while her sister, Mandy, was married to the seven-times world champion Stephen Hendry, and he started playing as soon as he was tall enough to reach over a table.

His parents were also committed to helping him succeed, to the extent they took him out of school at 15 and paid for a tutor so he could travel to tournaments.

Quick Guide Five of snooker's most seismic shocks Show Stuart Bingham v Stephen Hendry (2000): Seven-time champion Hendry was expected to get the latest defence of his title off to a straightforward start against world No 97 Bingham, who was making his Crucible debut after coming through the qualifiers. Hendry led 5-4 after the opening session but Bingham won five of the next six frames and produced a break of 87 to send Hendry crashing out on the opening day. Tony Knowles v Steve Davis (1982): Davis had won the first of his six world titles the previous year and was an odds-on favourite to defend his crown. Bolton qualifier Knowles had other ideas however, racing into an 8-1 overnight lead and winning the first two frames the following day to seal a stunning victory. Michael Wasley v Ding Junhui (2014): Wasley was making his Crucible debut against an in-form Ding, who came into the event on the back of winning five ranking titles during the season. Ding looked in command when he led 6-3, but Wasley recovered to trail 9-8 before the players were forced to come back for a rare third session after overrunning their allocated time slot. World No 73 Wasley produced a break of 103 to force a decider which he clinched on the final pink after midnight. David Gray v Ronnie O'Sullivan (2000): O'Sullivan had reached the semi-finals in 1999 and won the first of his five world titles in 2001, but in between suffered a shock defeat to Gray, who went on to lose 13-1 to Dominic Dale in the second round. O'Sullivan led 5-1 and 9-7 but could not scramble over the line and Gray held his nerve to secure a famous win. Rory McLeod v Judd Trump (2017): Trump was among the favourites for the title in 2017 and faced 1,000-1 outsider McLeod in the opening round, but could only manage a top break of 65 in a low-scoring contest. McLeod's highest break was only 77 but he played gritty match snooker to overcome an early deficit to win 10-8. PA Photograph: Tom, Shaw/02 ALLSPORT UK

It certainly helped in the early part of Cahill’s career as he was able to turn professional as a teenager after winning the 2013 European Under-21 championship. However after a bright start to his professional career he struggled and slipped out of the professional ranks after failing to make it through qualifying school last year.

But hours of practice at the Stephen Hendry Snooker Club in Preston – owned by his mother – has honed his game. Victories over the former world No 1 Mark Selby last autumn and now O’Sullivan have given him the confidence to believe his Crucible adventure is not going to end any time soon.

“I have always believed in myself and that I can beat anyone on my day,” said Cahill, who plays Stephen Maguire in the second round. “Hopefully I can kick on.”