Gukesh won Thursday’s game with the black pieces after Ding wilted under pressure and blundered in what commentators considered to be a comfortable position, snatching the title with a final score of 7.5-6.5.
Ding, 32, slumped on the table after he realised he had made an endgame error that gave his opponent an opportunity to pounce.
Gukesh burst into tears, putting his face in both hands when he realised he was the new world champion.
Cheers from jubilant fans erupted at the viewing rooms near the playing arena.
Magnanimous in victory, Gukesh praised Ding, saying he “fought like a true champion”.
The match was a 14-round long-time “classical” event with a prize fund of US$2.5 million.
World number one Magnus Carlsen, who had been world champion since 2013, relinquished his title in 2022, citing a lack of motivation.
Gukesh qualified in April by winning the Candidates tournament.