Under darkened Beijing skies there was a moment of blinding light. For two years Justin Gatlin has been the undisputed king of sprinting as well as athletics’ most notorious character but, cometh the hour, cometh Usain Bolt – by the narrowest of margins in a messily thrilling 100m world championships final.

With 20m to go the two men were locked together in a desperate tango, stretching and straining for the line. But then Gatlin over-reached, stumbled and, in a flash of 50,000 camera-phones and a whoosh of cheers, Bolt had him – just. The Jamaican’s gold medal time was 9.79sec to Gatlin’s 9.80, the width of a vest.

Behind them came two slight 20-year-olds who many believe are the future of sprinting, the Canadian Andre De Grasse and the American Trayvon Bromell, who shared bronze in 9.92.

As the youngsters hugged, Bolt launched into his familiar victory routine. This was his ninth world championship title – more than any athlete in history – but also his hardest. “It definitely means a lot because I’ve been struggling all season,” he said. “Justin has been running great so I knew it wasn’t going to be easy. But after I joined him around 80m all I kept telling myself was run through the line. I could see him stumbling but it could have helped his momentum so I had to keep my focus.”

Gatlin was gracious in defeat but one could taste his disappointment. Five times this year he has run the 100m quicker than Bolt’s winning time but when the adrenaline was blasting through his veins he could not quite keep it together.

“Really, I gave it away,” he sighed. “I stumbled in the last five metres, my arms got a little flaily. But I’m happy to come so close and to represent my country.”

But he also paid tribute to Bolt, saying: “He’s a gamer. He’s a showman. Anyone who goes to the line to go against him has to be ready to go to work. But I let things get away from me. I stumbled a little and it cost me the race.”

All major 100m finals are gladiatorial contests. But this track-and-field superfight carried a particularly sharp edge. Bolt and Gatlin had not faced each other for nearly two years, during which Gatlin had accumulated a winning streak over 100m and 200m of 29. Bolt’s unbeaten record outside heats, meanwhile, stretched back even further to June 2013 when Gatlin had defeated him in Rome.

But as they say in boxing, somebody’s O had to go and, while the winning time was nothing special, the occasion certainly was.

Before the start both men limbered up like boxers, rolling their necks and puffing out their cheeks. When Bolt was introduced he covered his eyes with his hands before opening them and smiling; Gatlin shot imaginary bullets with his fingers before roaring into the camera.

Jessica Ennis-Hill wins heptathlon gold at Beijing World Championships Read more

In the semi-finals Gatlin had made his trademark explosive start on the way to a comfortable victory in 9.77. Bolt, however, had risen from his blocks like a man who had overslept on a rock-hard mattress, before struggling to win his heat in 9.99. On that evidence the American was the clear favourite but in the final something clicked for Bolt. He was up like a shot and tracked his target all the way, before seizing the moment when Gatlin made his desperate dive for the line.

Afterwards, when Bolt was asked whether he was worried after his semi-final, he shook his head. “I never doubted myself,” he said. “I know my ability. It wasn’t the perfect race but I got it done and I am happy.”

It was inevitable that some would hail this a victory not just for Bolt but for clean athletics. It was understandable too, given Gatlin’s past – which includes a four-year ban for taking the banned steroid testosterone – and his startling present, which has seen him set personal bests in the 100m and 200m at 33.

The danger is that it is both simplistic and lets other athletes off the hook. Remember 66 athletes at these world championships have served doping bans – including four in the 100m final. One victory from an athlete who has never tested positive will not change that.

Not that Gatlin made any effort to endear himself to those who have long condemned him. When he was asked about his doping past after the race he replied with three words: “I am thankful.” Asked to elaborate, he was a little more expansive. “I am very thankful,” he said. Gatlin’s supporters insist that his improvement is down to losing 25lb since his comeback in 2010 and to better bio-mechanics.

As Gatlin answered, Bolt started to giggle. Shortly afterwards he nodded when asked whether it was possible to succeed clean. “I have shown the world that it is possible. I have worked my hardest. I have pushed myself,” he said. “I have to give thanks to my coach and Dr Müller-Wohlfahrt, my German doctor. It’s about being focused and working hard.”

He left the stadium sporting the broadest smile. It was in the Bird’s Nest in 2008 that he first announced himself as a global superstar, by winning Olympic 100m and 200m gold in world record times. And after a difficult couple of years, where he has been beset by injuries, it was once again where he has found his wings.