O'Sullivan's bid for a sixth world title came to a premature end after a shock 10-8 defeat at The Crucible in Sheffield, UK, Sky Sports reported.
He had trailed 5-4 after the first session on Monday but, despite levelling the score at 8-8 when they resumed on Tuesday, still succumbed to a huge upset.
A 104 break by O'Sullivan restored faith that he could recover but Cahill didn't panic, and retained an 8-6 lead.
O'Sullivan dragged himself level but the match hinged on a missed pink at 8-8, with the world No 1 trailing 61-62. Cahill pinched that frame and never looked back.
Cahill, 23, became a professional in 2013 and his highest world ranking was No. 76. He has since rejoined the amateur circuit and came through qualifying to make the World Championship.
He became the first amateur to qualify for the tournament, and is the nephew through marriage of seven-time world champion Stephen Hendry.
O'Sullivan said afterward, "I haven't felt great for a few weeks. All my limbs feel really heavy. I feel absolutely shattered and drained, I was struggling to stay awake.
"You have to come here feeling physically and mentally good. You don't expect to do well here but I came here trying to do my best.
"I tried to hang in there and tried to do as much as I could to see if I could get through this match and have a few days off and feel better. But it didn't happen."