Usain Bolt has roared into Olympic history, capturing an unprecedented third consecutive 100 metres crown to confirm his place in the pantheon of the greatest athletes the world has seen.

The 29-year-old Jamaican legend, competing in his final Olympics, powered over the line in 9.81 seconds, vanquishing drug-tainted American rival Justin Gatlin who took silver with Andre de Grasse of Canada claiming bronze.

Gatlin, who had been booed by the Rio crowd as he was introduced, crossed in 9.89 with De Grasse just behind in 9.91.

Bolt galloped away in celebration after a superb win, basking in the adulation of the stadium and even taking selfies with fans during his lap of honour.

An athlete who transcends his sport

Bolt, the 2008 and 2012 Olympic champion, had already earned the right to be regarded as the greatest sprinter in the history of athletics after accumulating more golds on the track than anyone else.

But the Jamaican's latest triumph erases any last lingering doubts that he deserves to be ranked alongside the likes of Muhammad Ali, Pele and Michael Jordan as the kind of once-in-a-generation athlete who transcend their sports.

Bolt's win — his 18th gold in Olympic and world championships since 2008 — averted what might have been a public relations disaster for the drug-tarnished world of track and field.

A corruption scandal involving the sport's former rulers, who were accused of accepting bribes to cover up positive drug tests, and an investigation which alleged an elaborate state-sponsored doping system in Russia have plunged track and field into the worst crisis in its history.

A gold medal for Gatlin would have made uncomfortable viewing for many — world athletics chief Sebastian Coe among them — who have advocated that serial doping offenders should be banned for life.

But those fears were swept away by the smiling, laughing figure of Bolt, for so long the sport's most charismatic showman.

Gatlin, who has served two drug bans during his long career, made a powerful start to lead over the first 50 metres.

But as soon as Bolt's head came around the midpoint the American was in trouble and the defending champion surged home around a metre clear of the field.