The Rio Olympics ended in a blaze of colour with an exuberant closing ceremony on Sunday as Tokyo took up the baton promising to host the best Games yet in 2020.
After a rollercoaster fortnight which mixed off-field hitches with compelling sporting drama, Olympics chief Thomas Bach hailed a "marvellous" Games in the Brazilian city.
"These were marvellous Olympic Games in the marvellous city!" said Bach, as he declared the Games closed and the Olympic flame was extinguished.
"These Olympic Games are leaving a unique legacy for generations to come. History will talk about a Rio de Janeiro before and a much better Rio de Janeiro after the Olympic Games."
Just a few hours earlier, the United States basketball squad won the last gold of the Games, boosting their country's place on top of the medals table.
At the closing ceremony, thousands of fans and athletes donned ponchos on a wet and windy night for a colourful festival of Brazilian culture and music with bursts of spectacular fireworks.
Smiling and waving athletes danced into the Maracana stadium taking selfies as Rio's 16-day Summer Games closed ahead of the 2020 Olympics in Tokyo.
Japan's Prime Minister Shinzo Abe made a comical cameo as Nintendo video game character Super Mario as Tokyo set out its store for 2020.
"The Japanese government will... work hard so it will be the best Olympics ever," Abe said as he met Japanese medal-winners earlier.
Security scares and logistical problems were a feature of South America's first Olympics, held against the backdrop of Brazil's political and economic crisis.
Swathes of empty seats caused disquiet but the Games also witnessed the last hurrahs of both Usain Bolt and Michael Phelps, who both lived up to their billing.
Bolt sealed the sprint 'triple triple' in his final Games, reaching a record-equalling nine gold medals with his third consecutive 100m, 200m and 4x100m sweep.
Swim legend Phelps took his unmatched career haul to 23 gold medals with another five in Rio -- plus a silver, after his loss to former childhood fan Joseph Schooling.
Brazil came late to the party but the country celebrated long and loud when Neymar won a gold-medal penalty shoot-out against Germany to erase memories of their 7-1 World Cup semi-final humiliation in 2014.
- 'Sporting superpowers' -
On a sodden final day, Kenya's Eliud Kipchoge, 31, shone with his seventh win in eight marathons, timing 2hr 8min 44sec to win by more than a minute.
The USA's basketball 'Dream Team' of NBA stars claimed the 306th and final gold of the Games with a crushing 96-66 win over Serbia.
With the basketball win, America matched its tally of 46 golds from London four years ago to lead the medals table from Britain, who sealed surprise second place ahead of China with 27 golds to 26.
"We are one of those sporting superpowers now," beamed UK Sport chief executive Liz Nicholl.
But there was also controversy as Mongolia's Chagnaadorj Usukhbayar became the sixth weightlifter in Rio to fail a drugs test.
And police seized passports, phones and computers in a raid on the Irish Olympic office, following the arrest of Irish International Olympic Committee member Patrick Hickey over an alleged black market tickets scam.
Brazil added a final flourish as they beat Italy 3-0 to win the men's title in volleyball, one of the country's most popular sports.
French fighter Tony Yoka won a split-decision against Britain's Joe Joyce to take the super-heavyweight title in boxing.
Switzerland's world champion Nino Schurter, third in Beijing and second in London, competed his ascent of the podium by winning the men's mountain bike competition.
And there were furious scenes when a Mongolian coach stripped down to his underwear to protest a decision against wrestler Ganzorig Mandakhnaran.
AFP
Mon Aug 22 2016
Japanese Prime Minister Shinzo Abe holds a red ball during the closing ceremony of the Rio 2016 Olympic Games at the Maracana stadium in Rio de Janeiro on August 21, 2016. / AFP PHOTO / PHILIPPE LOPEZ
Millions in Cuba still without power as major outage persists
Millions of Cubans remain without electricity because of a prolonged outage at the main power plants on the island, Anadolu Agency reported.
Surge in Gaza violence increases famine risk, monitor says
About 1.84 million people across the besieged Palestinian enclave are living through high levels of acute food insecurity.
Israel pounds Beirut and Gaza after rockets hit Israel's north
A drone was launched at Prime Minister Benjamin Netanyahu's holiday home.
Elon Musk promises to award $1 mil each day to a signer of his petition
He awarded a $1 million check to an attendee of his event in Pennsylvania aimed at rallying supporters behind Donald Trump.
Former special forces commander Prabowo to take up Indonesian presidency
Indonesia's Prabowo Subianto will take over as president of the world's third-largest democracy after sweeping the country's election with policies like free meals for school children
Father of Malaysian Islamic banking, Abdul Halim Ismail passes away
His dedication and pioneering spirit played an important role in shaping the journey of Bank Islam as well as leaving a lasting impact on the development of Malaysia's Islamic finance industry.
Zayn Malik postpones US tour dates after One Direction bandmate Liam Payne's death
Payne, 31, died on Wednesday after falling from a third-floor hotel room balcony in Buenos Aires, shocking fans of the boy band.
Why voters in a handful of swing states will decide the US presidential election
The contest will almost certainly be decided by just tens of thousands of voters a tiny fraction of the populace in a handful of states.
INSIGHT - Sudan's war risks 'lost generation' of children
A devastating crisis is unfolding in Sudan, where the most vulnerable members of society children are bearing the brunt of the violence.
Who is Prabowo Subianto, incoming president of Indonesia?
A wealthy ex-general with ties to Indonesia's popular outgoing president and its dictatorial past, looks set to be its next leader.
Trump says he would impose tariffs on China if China went into Taiwan
Republican presidential candidate Donald Trump said he would impose additional tariffs on China if China were to "go into Taiwan,"
Iran's supreme leader says Hamas leader's death will not halt 'Axis of Resistance'
The "Axis of Resistance", built up with years of Iranian support, includes Hamas, the Lebanese Hezbollah group, the Houthi movement in Yemen, and various Shi'ite groups in Iraq and Syria.
Putin says Russia willing to seek compromises between Iran and Israel
Russia is ready to help seek compromises between arch-foes Israel and Iran, President Vladimir Putin said on Friday, saying these would be difficult but possible.
What proposals will Russia push at the BRICS summit?
The proposal is also to establish a BRICS reinsurance company to allow uninterrupted shipment of goods and key commodities between members.
Indonesia's free meals plan in the spotlight as Prabowo readies for office
Prabowo calls the programme one of the main drivers of economic growth, eventually set to add an estimated 2.5 million jobs.
Astro AWANI's revamped English news website, AWANI International, launches on Oct 21
Astro AWANI's revamped English platform delivers in-depth global news and expert analysis to keep you informed on key developments.
Israeli strikes kill 33 people in Jabalia refugee camp in Gaza, medics say
Residents of Jabalia said Israeli tanks had reached the heart of the camp after pushing through suburbs and residential districts.
Liam Payne's ex-partner calls for media restraint after 'painful' death
Cheryl Tweedy used her statement to urge the media to remember they had a seven-year-old son, Bear, who could read the reports.
Analysts: Indonesia's strong MoF leadership team to boost investor confidence
Sri Mulyani Indrawati as head of Indonesia's Ministry of Finance is expected to instil confidence among investors.
Biden offers both a carrot and a stick to Israel as his term nears an end
Israel has frequently resisted US advice and has caused political difficulties for the Biden administration.