Tokyo has won the right to host the Olympic Games for the second time, overcoming fears about radiation from the stricken Fukushima nuclear plant to land the 2020 edition of the world's biggest sporting event.
Members of the International Olympic Committee (IOC) meeting in Buenos Aires chose the Japanese capital, which previously hosted the Games in 1964, over Istanbul, after Madrid was eliminated following a first-round tie with the Turkish city.
Crowds gathered in Tokyo broke into wild cheers, despite the result coming in the early hours of Sunday morning nearly a dozen time zones away.
Japan's Prime Minister Shinzo Abe had earlier flown in to the Argentine capital from the G20 summit in St Petersburg, Russia, to reassure nervous members about the safety of the nuclear plant some 220km from the city and fears about the leaking of contaminated water.
He told delegates that the situation was "under control", adding: "It has never done or will do any damage to Tokyo."
Fukushima operator the Tokyo Electric Power Co also played down fears of a possible spread of radiation in a separate message.
The final result in the Argentine capital on Saturday was 60 votes for Tokyo against 36 for Istanbul, said the IOC.
Tokyo - third in the vote for the 2016 Games won by Rio de Janeiro - had been the frontrunners originally, as they promised a safe and financially secure Games in what they termed "uncertain times".
The decision means it will be the fourth time that Japan hosts the Olympics, having also organised winter Games in Nagano (1998) and Sapporo (1972).
Asia will also see successive Olympics, as the South Korean resort of Pyeongchang is hosting the 2018 winter edition.
Madrid had looked to be the city with the momentum coming into the final week after an outstanding presentation to IOC members in Lausanne in July - and were hoping that like Rio de Janeiro for the 2016 race, they could go on to win.
But it was not enough, even with 28 of the 35 venues built and all the infrastructure in place plus a positive assessment by the IOC Evaluation Commission - the only IOC members allowed to visit the bid cities - over their relatively low budget.
Doubts about Spain's recession-hit economy persisted to the end and not even some more upbeat news on the issue recently and Prime Minister Mariano Rajoy's pledges that financing would not pose problems convinced enough members that they could deliver.
Istanbul had been hoping Turkey would become the first predominantly Muslim country to host the quadrennial sporting extravaganza.
But despite a passionate and dynamic campaign trading on bridging two continents and two cultures as well as an evocative "wake up in Asia compete in Europe" slogan, their bid was hampered in June.
Several IOC members were unimpressed by the heavy-handed way that the Ankara government handled anti-government protests that escalated from opposition to the redevelopment of an Istanbul park.
There was also nervousness surrounding the fallout from the bloody civil war in neighbouring Syria.