After running side by side for miles with world champion Abel Kirui and Wilson Kipsang, the 23-year-old put in a powerful kick to shake off the Kenyans and crossed the finish lane draped in the Ugandan national flag, which he knelt to kiss.
The dense throngs that lined the route through central London on a sweltering day were a sign of the huge enthusiasm the Games have generated in a host country where many had been sceptical about the cost and potential disruption.
Britain's best medal haul for a century, the record-breaking exploits of swimmer Michael Phelps and the sprint pyrotechnics of Usain Bolt, who won his third London gold when Jamaica smashed the 4 x 100 metres world relay record on Saturday, have made for a memorable Olympics.
Starting the final day of competition on 44 gold medals, six ahead of China, the United States were already unassailable at the top of the overall table.
They were looking to add to their haul as their basketball "Dream Team" defended the title against a Spanish team looking for revenge for defeat in the final at Beijing four years ago.
"We all know what's on the line," said U.S. player Kevin Durant. "They're going to come out and give us their best shot. We got our work cut out for us."
Women's modern pentathlon will be the last event to round off the two-week extravaganza of sport before some of Britain's best-known pop acts, including The Who and George Michael, play out the closing ceremony.
The U.S. basketball team will find it hard to top Saturday's spectacle on the track when Bolt anchored the Jamaicans to relay gold and Britain's Mo Farah claimed the 5,000 to go with his 10,000 title.
Bolt added the relay crown to the 'double double' he won in the 100 and 200, defending both after his Beijing triumphs and writing his way into Olympic history as one of the finest - and zaniest - sprinters the world has known.
As he crossed the line, Bolt made his hands into an 'M' shape above his head - a nod to Farah's famous celebration while the Briton later copied Bolt's well-known lightning strike pose as two of the stand-out performers of the Games had fun.
Farah, contributing to Britain's 28 golds, is the seventh man to win the 5,000 and 10,000 titles at the same Olympics.
British Prime Minister David Cameron hailed his heroics as well as the country's response to the Games as a whole.
"It's an enormous confidence boost about who we are as a country, what we can do, what we stand for, and the fact that we can make our way in a very tough and competitive world," he told the BBC.
The final moments of Olympic glory in track and field on Saturday brought a close to an eventful penultimate day of the Games in which startling athletic prowess did not completely dominate the headlines.
Syrian athlete Ghfran Almouhamad, who competed in the women's 400 metres hurdles, was the 11th athlete to be excluded from the Games since July 16 after testing positive for a banned substance.
The 10-strong Syrian team has attracted considerable media attention during London 2012, less for its sporting achievements than for the bloody conflict raging at home between rebels and forces loyal to President Bashar al-Assad.
On Sunday, two Egyptian wrestlers were disqualified for arriving late for the start of their competition. No one had told them that Sunday's bouts started earlier than usual because of the closing ceremony later in the day.
Despite concerns about the creaky transport system and a shortfall of private security guards, which forced the government to call in thousands of extra troops to help screen visitors, the Games have so far passed by relatively trouble-free.
A furore over empty seats at several Olympic venues blew over, especially once the track and field showcase kicked in and drew in capacity crowds.
Even the weather improved as the Games wore on. Bright sunshine has graced the closing weekend of a festival that has helped to lift the gloom in recession-hit Britain.
Cameron has tried to use the Olympics to woo investment to Britain, hoping they would give the economy a much-needed boost, although some London businesses complained that warnings about overcrowding from the Games had driven customers away.
The Spice Girls and One Direction, are among those expected to perform in the closing ceremony as London prepares to bid goodbye to what The Guardian newspaper dubbed the "feelgood Games".
As well as a "hit list" of more than 30 popular songs, the closing ceremony will feature thousands of athletes and performing volunteers and a section devoted to the next summer Olympic hosts, Rio de Janeiro.
"I think it's a gift that we've got Rio next because their eight minutes is so wonderful and really full of that samba beat," artistic director Kim Gavin said of the 2016 hosts.