Ding won the opening frame against Selby with a break of 78, but was forced to endure some frustrating times in the next two frames as Selby pocketed both on the final black.
Selby, fresh from his 10-8 win over Neil Robertson that sealed his third Masters success in London, would miss a tricky red to a middle bag holding a 59-1 lead in the second frame, but it was not fatal despite watching Ding close with 35 to force a re-spotted black.
Selby would cut the black from distance before a 33 clearance in the third frame saw him pinch it by six points with Ding missing a red on 55 with the rest that would have sealed the frame.
Selby did not waste too much time in moving 3-1 ahead with a 91 knock before Ding encountered further hardship when he broke down on 60 in failing to sink another red with the rest.
Selby returned to the table to run in 39 and claim his third frame out of five on the final black.
Ding - a double UK champion - showed he was far from dead by punishing Selby for missing a red to a middle hole in the sixth frame as an 87 kept his hopes alive.
His prognosis looked better when a 96 enabled him to close to 4-3 behind, but missing a red to a middle pocket in the penultimate frame ultimately ended his aspirations as Selby concluded his business by clearing to the pink with 48.
Marco Fu meets Matthew Stevens in the quarter-finals after he completed a gritty 5-3 win over Peter Lines with a knock of 80 in the closing frame of the match.