Gatlin, who served a doping ban between 2006-10 and won silvers behind Bolt at the last two world championships, clocked 9.92 seconds, with teammate Christian Coleman winning silver in 9.94sec.
Bolt suffered a dreadful start and could only claim bronze in 9.95sec.
"I'm sorry I couldn't end it on a winning note, but I want to thank you for your support," said Bolt, who embraced Gatlin after they streaked through the line with no clear victor immediately apparent.
"It's been a wonderful experience as always."
Gatlin was afforded the same rough reception as he had in the heats and semi-finals, loud boos and jeering ringing around the same stadium where in 2012 his rivalry with Bolt was presented as 'good against evil', given the American's doping-tainted past.
But Gatlin has form as the last man to beat Bolt over 100m -- by a hundredth of a second in Rome in 2013 -- and at the age of 35, can still produce the goods, something he has in the past ironically credited with his four years of forced exile from the track.
- Countries: Jamaica