Ding burst into a 3-0 lead in the morning session, but O'Sullivan levelled matters at 4-4, before Ding took control again in the evening.
The world number four took frame one thanks to a break of 71 and then followed it up a magnificent 128 clearance. O'Sullivan hardly got to the table as another 71 put Ding 3-0 in front.
However O'Sullivan hit back with a 63 to finally get on the scoreboard, and took the next two frames after the mid-session interval thanks to breaks of 99 and 65.
Ding took the next on a respotted black before five-time world champion O'Sullivan levelled again with a break of 59.
Into the evening session and again Ding took control with a top breaks of 63, 58 and 120 helping him stretch his lead to 10-5.
O'Sullivan, though, produced a defiant rapid-fire 104 in the final frame to give himself a chance, but still has his work cut out to make the semi-finals.
On the other table, John Higgins finds himself two frames away from victory as he leads Kyren Wilson 11-5.