World number one Selby, champion in 2014, never trailed in the match as he ended Ding’s hopes of becoming the first Asian player to win the biggest prize in the sport.
“It is fantastic,” Selby said.
“It was very special to win it two years ago, but I felt under a lot more pressure now than I did two years ago.
“It was a tough final and with the amount of pressure Ding is under, from China alone but to play like that. I can’t imagine how he could do that.”
Ding, who lost the first six frames, fought back on Sunday to leave Selby 10-7 ahead overnight at the Crucible Theatre in Sheffield, England.
The Chinese player started well on Monday and reduced the deficit to 11-10 but Selby rallied and went into the final session 14-11 ahead.
Selby, 32, extended his advantage to 16-11 but Ding, the first Asian player to reach the final, was not finished, conjuring up breaks of 70, 73 and 103 to fight back to 16-14.
The 31st frame was crucial, Selby producing superbly disciplined snooker to win it after a 51-minute tactical battle and he dominated the next to seal the title.
“In the first to 18, a 6-0 lead is not a huge one, especially against someone like Ding,” said Leicester-born Selby who secured the title minutes after his home-town football club won the Premier League crown.
“He played fantastically earlier today and I had to just hang on to him. I’m just over the moon. I saved my best performance for the final and I only had two good sessions in the tournament.”
Selby became the 13th player to win the world title more than once.
Only three players from outside Britain and Ireland have won the crown, Australian Horace Lindrum in 1952, Canadian Cliff Thorburn in 1980 and Australian Neal Robertson in 2010.
“I had a very bad start 6-0 down, I couldn’t win a frame. I was a bit nervous as I hadn’t been in a final before,” said the 29-year-old Ding, a former world number one who had to qualify for the tournament after slipping to 17th in the world rankings.