The Rocket turned on the style at times in the evening session, with a century break of 117 the highlight in a high-quality encounter.
World Championship
'I need to be patient' - McGill on defeat to Bingham at Crucible
28/04/2021 AT 19:30
O'Sullivan will go on to face Mark Williams in the quarter-finals.
With the match tied at 8-8 after Saturday's play, the two players exchanged breaks in a top-class match, with Ronnie going 10-8 up only for Ding to respond with a break of 88.
But it was the 20th frame that gave O'Sullivan the decisive edge, taking advantage of an error by Ding to rescue the frame and open up a two-frame lead.
Ding wasn't given another chance to make amends for his mistake, and the Rocket finished it off with a clearance of 93 - with only a wayward red preventing him ending with another ton.

Afternoon Session

Neil Robertson reached the quarter-finals of the World Snooker Championships following a 13-9 victory over Barry Hawkins at the Crucible in Sheffield.
With the scores at 8-8 heading into the afternoon session, the 2010 champion regained the lead with a break of 59 before he took the 18th frame as Hawkins missed a costly red.
Robertson took the 19th with a half century before Hawkins pulled back one with his only century of the afternoon.
In the end, though, it proved to be a relatively comfortable conclusion to the contest for Robertson.
The Australian responded with a 79 clearance after a lengthy 21st frame before sealing his place in his eighth World Championships quarter-finals where he will face Mark Selby.
Another player through to the last-eight is Kyren Wilson, who beat Martin Gould 13-9 on Sunday afternoon.
Gould was 11-5 down heading into the afternoon session and he started excellently, winning three frames in a row.
The Pinner Potter missed what looked to be a straightforward red, but he recovered to reduce the deficit with a 58 break before taking frame 18.
With Wilson appearing nervous, Gould snatched the 19th by punishing his kick on the black.
Nevertheless, any sign of a real comeback was slightly shortlived as Wilson took frame 20 having needed three snookers.
And although Gould registered a 73 clearance in frame 21, Wilson emerged victorious with a break of 79.
Wilson will face Judd Trump in the quarter-finals.
World Championship
'Just can't wait' - Emotional Bingham on reaching semi-finals
28/04/2021 AT 19:28
World Championship
'Brilliant pot' - Trump sinks outrageous long red from cushion
28/04/2021 AT 19:25