Justin Gatlin won his second world 100m title 12 years after his first to ruin eight-time Olympic champion Usain Bolt’s final individual race.
Bolt, who retires after next week’s 4x100m relay, was third behind American Gatlin, who clocked 9.92 seconds, and Christian Coleman (9.94).
Bolt’s 9.95 seconds equalled his best effort of 2017 but he always trailed.
Gatlin – banned twice for doping – was booed before the race and celebrated wildly, holding his hands to his ears.
The 35-year-old – in lane eight – was behind his compatriot Coleman from the blocks but wore down the margin in the closing 20 metres to take his first major title since 2005.
Great Britain’s Reece Prescod – who qualified for his first major final with an impressive time of 10.05 in the semi-final – finished seventh in 10.17.
Despite struggling for fitness and form in his valedictory season, Bolt had still been favourite to secure his 20th global gold.
It was supposed to be Gatlin’s year in 2015, when the American went to the World Championships in Beijing on the back of a 28-race unbeaten run.
Bolt produced his great miracle to beat him that night in the Bird’s Nest, but in the stadium where he won 100m Olympic gold in 2012, he could not provide the perfect ending to a perfect career.
Gatlin, double Olympic champion in Athens in 2004, had been booed every time he went to his blocks at these championships, his doping past making him the cartoon villain of a troubled sport.
He was to have his revenge in spectacular style, standing tall and putting a furious finger to his lips as his win stunned the capacity crowd.
The crowd at the stadium took a little revenge of their own, chanting, “Usain Bolt! Usain Bolt!” as the result began to sink in.
But this was a deserved victory in its execution if not its formation, a last hurrah for a man that many in the sport wished no longer had the chance to compete.