The 11-time World Championships gold medallist, who finished second to American Christian Coleman in his semi-final earlier this evening, had to make do with third place and a bronze medal in the final at the London Stadium as he said farewell to the race which saw him become one of the biggest stars in world sport.
It looked as though Coleman might win the gold until he was overtaken by Gatlin in the closing stages of the race, with the United States claiming gold and silver ahead of Bolt and compatriot Yohan Blake.
Gatlin, who has served two lengthy drugs bans during his controversial career, was roundly booed before and after the race, but paid tribute to Bolt by bowing down at the Jamaican's feet following confirmation of his victory.
The American missed out on first place to Bolt at the last two World Championships - in addition to the past two Olympic Games - but he finally clinched his first major gold medal since the 2005 World Championships in Helsinki.
The race brings an end to a legendary career for Bolt, who has won seven individual golds at the World Championships, three of which have come in the 100m.
The sprinting icon, widely regarded as one of the greatest athletes of all time, retires having won eight Olympic gold medals in addition to his success at the World Championships.