The controversial Gatlin came into the final on a 28-race unbeaten run and apparently relishing his role as the sport's bad guy.
But at the same Bird's Nest stadium in Beijing where Bolt announced himself to the world with two Olympic golds and two world records in 2008, the Jamaican superstar came past a faltering Gatlin at the death to snatch victory by one hundredth of a second.
Bolt's 9.79 seconds was more than two tenths off his world record, but this was a night for athletics to celebrate victories rather than times.
Canada's Andre de Grasse and young American Trayvon Bromell were both awarded bronzes in 9.92secs.
Few noticed. This was once again the Bolt show, even as the world doubted him, even as his own struggles this summer continued in a semi-final when he stumbled and almost fell.
Gatlin had looked unbeatable in running 9.77secs in his own semi-final, but starting out in lane seven - US team-mate Tyson Gay between him and Bolt in five - he was the slowest of the main contenders from the block.
In every race this season his technique has been as certain as his reception has been chequered. Yet, with Bolt out faster and level with him at 50m, he tightened up horribly in the last 30 metres and staggered through the line as Bolt flew through.
The characterisation of this showdown as good versus evil was always overplayed. Neither is it redemption for a sport when the final contained three other men who have also returned from doping bans.
Yet it is another reminder, if any were needed, of both Bolt's peerless competitive and athletic abilities and how much his sport owes him.
'It's been a struggle'
Reigning Olympic and world champion Bolt had struggled for form throughout 2015, with his best time of the year coming into the final a run of 9.87secs at London's Anniversary Games in July.
"This means a lot because I've been struggling all season, it's taken me a while to work things out," Bolt told BBC Sport.
"It's been up and down but it's OK now."