The 42-year-old survived a huge scare to beat Akani 6-5 in York.
But he relied heavily on luck to dig him out of a number of sticky situations in the final few frames.
The Thai whizkid was only a few shots away from claiming a remarkable victory but he potted the blue and green ball accidentally on the 10th frame.
O’Sullivan responded by levelling the scores to 5-5 before snatching the last game.
Akani had a final chance to win the match after O’Sullivan missed a routine red, but he followed suit and handed the impetus back to the world number 14.
At least twice O’Sullivan had to stare defeat in the face, but luck was heavily on his side and he knew it.
“I felt sorry for him,” O’Sullivan said.
“He deserved to win and I felt like I robbed him of victory.”
O’Sullivan set up a quarter-final tie against Martin Gould with the win.
Meanwhile, Akani said: “It was a fantastic match.
“I really enjoyed it and am very happy.
“He is my hero.”