As the curtain fell on the first Olympics in South America on Sunday night in Brazil, the Rio edition will be remembered as the Games of many firsts.
Nine territories - Vietnam, Kosovo, Fiji, Puerto Rico, Bahrain, Jordan, Tajikistan, Cote d'Ivoire and Singapore - won their maiden Olympic gold medals, while trap shooter Fehaid Aldeehani captured the first gold for the Independent Team.
It was also the first time a refugee team competed alongside the 206 National Olympic Committees. The team of 10 had athletes from Syria, Ethiopia, South Sudan and the Democratic Republic of the Congo.
Notwithstanding these breakthroughs, the XXXI Olympiad had its controversies as the host, plagued by a slumping economy and political instability, had to contend with a plethora of issues, including infrastructure, the Zika virus, water pollution and safety.
Most of these concerns were addressed or overblown, and while there were several cases of theft and armed robbery involving athletes and officials, the 306 events across 28 sports during the 17-day competition ran without any major disruption or security incident.
Initial public apathy from the Brazilians gave way to greater enthusiasm as Brazil began winning medals. It reached a climax at a sold-out Maracana Stadium last Saturday when Neymar and company delivered a historic gold medal in football, the country's first in the event after six decades of failed attempts.
A massive storm in Rio during the closing ceremony forced many in the Maracana to don ponchos but did little to ruin the festive mood as athletes joined spectators for the three-hour show which included the official flag handover ceremony to the Tokyo 2020 delegation.
National sailor Griselda Khng was Singapore's flag-bearer and led the country's 11-member contingent.
The closing ceremony featured music and dance performances of Brazilian heritage, elaborate costumes and light shows, and closed with a carnival-themed parade followed by a massive fireworks display. There was much to cheer for Brazilian sport, which recorded its best gold and overall medal haul of seven golds, six silvers and six bronzes to finish 13th in the standings.
The United States, despite having to weather the self-inflicted embarrassment caused by swimmer Ryan Lochte and his false claims about being robbed at gunpoint in Rio, topped the table with 46 golds, ahead of Britain (27) and China (26).
Russia, whose entire athletics team was banned due to doping allegations, participated under a cloud of suspicion and finished fourth with 19 golds. Japan, Olympic hosts in four years, were sixth with 12 golds, while their 41 medals were a record and cause for optimism ahead of the 2020 edition.
The Rio Games were a step in the right direction for South-east Asia, whose combined 18 medals (five golds, 10 silvers, three bronzes) were a new all-time mark for golds and total medals. Singapore swimmer Joseph Schooling's sensational victory in the 100m butterfly, beating 23-time Olympic champion Michael Phelps, was a major highlight for the Republic and the region.
This was the final Olympic outing for American legend Phelps and his counterpart on the track, Jamaican great Usain Bolt, signalling the end of an era for two of the greatest athletes of this or any generation.
But Rio was also the site for a new wave of stars to introduce themselves to a global audience - estimated at 3.5 billion. The likes of Simone Biles (gymnastics); Kosuke Hagino and Adam Peaty (swimming); and Andre de Grasse, Wayde van Niekerk and Elaine Thompson (athletics) showed the future of the Olympics is in safe hands as the flame was extinguished and the sporting world bade farewell to Rio and the continent.