Heading into the final session with a 6-3 lead the 43-year-old Englishman looked in fine form after a 131 break in the final frame of the afternoon.
However, his gritty opponent hit back in the evening session, taking six of the next eight frames to move to within one of victory.
World Championship
'A special place in sport' – Why World Championship must stay at Crucible
10/09/2021 AT 18:28
O'Sullivan was not finished though and won the penultimate frame to set up a decider.
And it was then that his class shone through, a century securing a dramatic victory.
"We both didn't play great," said O'Sullivan.

'I was lucky'

"I'm just pleased to be competing. My main goal is to come out here and enjoy it, play with freedom.
It's just a game. It's nice to still be playing.
"It's a great venue, great tournament, great crowd. If everyone's enjoyed it, then great.
"We want to perform and play the best we can.
"I was lucky today - that double there, I got away with it."
Has any pool player conquered snooker? Trump set to take plunge in Atlantic City
08/09/2021 AT 17:08
Who does Stuart 'Ball-Run' Bingham rate the snooker GOAT?
07/09/2021 AT 11:40