The Chinese player - a former holder of the UK Championship and the Masters - was among the favourites to carry off the tournament, but somehow contrived to lose the match from 9-6 ahead having won five straight frames in the morning session after Day had eased himself 6-4 clear by snaring the first frame of the day with a knock of 70.
The world number 10 Ding missed a red on a run of 22 in the 17th frame before seeing a simple red stay out of a middle hole in the next frame when he seemed likely to score heavily. Day made 77 to keep the contest alive.
Another error in trying to leave Day snookered behind a black in overscrewing the white ball in the 18th frame suggested the tension was starting to affect Ding as Day compiled a priceless 33 before sinking the final red and blue to prompt the deciding frame.
Ding seemed poised for victory in that decider when Day missed a long red before sending the white crashing into the pack of reds. Ding made 48, but played his final shot of the tournament when he missed a red with the rest.
Day - who is down at 35 in the rankings - held himself together wonderfully to produce a nerveless effort of 64 as he punched the air in delight moments after slotting the final pink. Ding - who had made runs of 52, 56, 69, 46 and 57 to recover from 6-4 behind - looked a bit dazed. As he left the arena, his hopes of bettering last year's run to the last four went with him.
Day's reward is a meeting with Ding's compatriot Cao Yupeng in the last 16.
First session report
One point and one frame splits Ding Junhui and Ryan Day with Welshman Day 5-4 ahead in their World Championship last 32 meeting.
Day accumulated 439 points to Ding's 438 over the nine frames. That was reflected in the score after a tense first session with Day holding a narrow lead before they reconvene to play to a finish on Wednesday morning.
The pair shared the opening frames with Ding running in knocks of 63 and 47 in moving 1-0 and 2-1 clear only for Day to twice recover aided by a 77 run in the fourth frame.
Ding pieced together a break of 100 to move 3-2 ahead only for Day to respond with a 44 at the business end of the sixth frame to restore parity at 3-3.
Missing an easy black on 52 did not hamper Day in the seventh frame as Ding failed to capitalise among the balls in falling 4-3 behind.
A 46 was not enough for the Chinese player in the eighth frame as an astonishing miss on a straight red buried his hopes of making it 4-4 with Dale adding to an earlier 35 with a 31 for a 5-3 lead.
A 53 provided Ding with the platform to close to within one frame of Day, but he will be well aware that this match could yet go either way on Wednesday.