Usain Bolt pulled up with an injury on the anchor leg of the 4x100 metres relay final at the World Athletics Championships on Saturday as the last race of his unparalleled career ended in high drama.

The 30-year-old had taken the baton for Jamaica a few metres adrift when, straining hard to catch the leaders, he suddenly suffered a hamstring injury, began hobbling and ended up coming to a halt after doing a forward roll on the track.

After a short while though, he rose gingerly to his feet and limped across the line to huge cheers from the 56,000 crowd.

That wasn't the only surprise. Britain went on to beat the United States in a tight finish.

READ MORE: Usain Bolt, from strong child to track king

The 60,000-capacity stadium was primed for one last Bolt show, one last "To the World" pose after a victory, but the injury made it blatantly clear why Bolt is ready to retire. His body can no longer hold up.

His teammates on the once-fabled Jamaican sprint squad were far from unmatchable, too. Bolt had just too much to make up in the final 100 metres as both Britain and the US were ahead, and even Japan was even.

As Bolt fell to the ground, the leg with the golden shoe giving way, the crowd still went wild because the home team went on to win gold in 37.47 seconds, 0.05 seconds ahead of the US.

The brilliantly executed race by Chijindu Ujah, Adam Gemili, Danny Talbot and Nethaneel Mitchell-Blake gave Britain gold in 37.47 seconds, breaking an 18-year-old national record and the world title for the first time.

The result means Bolt, 100 and 200m world record holder, finishes his career with 14 world career medals, one behind American Allyson Felix, to go with eight Olympic golds.

Amid wild home celebrations, Bolt was attended to by medics, but refused a ride in a wheelchair off the track, instead finally getting up and limping alongside his teammates through to the finish line and then off into the stadium for treatment.

It was a sad exit for an athlete who has lit up the track when the sport has been dragged through its worst-ever crisis, racked by doping and corruption scandals that went to the very heart of athletics' governing body.

Since confirming his sprinting dominance with triple gold at the 2008 Beijing Olympics, Bolt spent nine seasons amassing 19 global golds, 13 of which have come in individual events.

Allied with a charismatic personality, it has guaranteed Bolt recognition as one of the world's most successful sportsmen. Last year alone he earned $34.2m, according to Forbes.

Al Jazeera's Sonia Gallego, reporting from London, said Bolt would be remembered as one of the all time great athletes.

"It's very unlikely that we're going to see anyone of his ilk very soon," she said.

"So really quite a sad end to Usain Bolt's career but hopefully not the end of him as a personality and as an ambassador for the sport."

Mo Farah's swansong

Before Bolt came onto the track, he was consoling Mo Farah, his long-distance equivalent who had just lost his first major race since 2011 when he failed to get gold in the 5,000 metres.

Farah also was bidding farewell to the track, coming up short of his fifth straight 5,000-10,000 double at major championships in a sprint against Muktar Edris of Ethiopia.

Farah, now 34 years old and a six-time world champion, knew the opposition would be gunning for him. And they did.

They boxed Farah in. They changed the pace of the race. They made him work hard knowing that his 10,000-metre victory on the opening day of the championships would take something out of his punishing finish.

"I gave it all," Farah said. "I didn't have a single bit left at the end."

Al Jazeera's Sonia Gallego said that Farah's silver was disappointing but that he had made a gracious lap of honour and posed with fans.

"Certainly a very honourable end for a tremendous athlete and certainly quite sad to see it happen in a place where he had made his name in such spectacular fashion back in the 2012 Olympics," said Gallego.

US takes gold in women's relay

Tori Bowie was the unlikely first double gold medalist at the championships, anchoring the US team to the 4x100-metre relay title ahead of Britain and Jamaica.

At the same time, Allyson Felix, running the second leg on the winning team, earned a record 15th medal at the world championships in a career going back to 2005.

Bowie, who won the 100 metres this week, ran a strong anchor leg, leaving behind the opposition to finish in 41.82 seconds.

"Two gold medals is amazing for me," Bowie said. "We are on top of the world."

Britain took silver in 42.12 and two-time defending champion Jamaica earned bronze in 42.19.