Ding, world number eight, had no grip of the contest from the off as he lost the first four frames, Hawkins securing the fourth with an impressive break of 108.
China's biggest star mounted a comeback when taking the next three frames, breaks of 64 in the fifth frame and 53 in the seventh seeing him claw back Hawkins.
But just when it appeared as though Ding might prevail, Hawkins put together a break of 87 after Ding had left the table with 20 on the board in the eighth frame to wrap up the victory. Hawkins will now take on Stephen Maguire in the last 16.
Stuart Bingham later recorded a 5-3 win over Liang Wenbo as China's second highest ranked player was also knocked out.
In the evening session in China, Mark Selby had an agonising moment when he missed on the final black to be denied a 147 in his first-round encounter with Mark King.
However, the world number two enjoyed two other centuries en route to a comprehensive 5-1 victory that sets up a meeting with Ricky Walden in the next round.
Neil Robertson was also in dominant form as he disposed of Jimmy Robertson 5-0, while Mark Allen cruised to a 5-1 victory over Anthony McGill, with a break of 129 in the second frame his highest of the day.
World number 11 Mark Williams had an easier time of things in the morning as he opened with a break of 108 in the first frame and went on to defeat Lyu Haotian 5-2, with Ali Carter awaiting him in the second round.
Ricky Walden and Mark Davis also made it safely through with wins over Ken Doherty and Dechawat Poomjaeng respectively.
China Open first round results:
Ding Junhui 3-5 Barry Hawkins
Mark Williams 5-2 Lyu Haotian
Ricky Walden 5-2 Ken Doherty
Mark Davis 5-3 Dechawat Poomjaeng
Mark Selby 5-1 Mark King
Mark Allen 5-1 Anthony McGill
Neil Robertson 5-0 Jimmy Robertson
Stuart Bingham 5-3 Liang Wenbo