Tokyo will host the 2020 Olympic and Paralympic Games after persuading voters in Buenos Aires that the tsunami-devastated nuclear plant at Fukushima posed no danger and that with Japan the games would be in 'safe hands'.
Beating Istanbul by 60 votes to 36 in the final round of voting, the result prompted an outpouring of joy in Japan's capital, with cheering crowds acclaiming the decision.
Tokyo last hosted the games in 1964, and will become the first Asian city to host the Olympics twice.
"I would like to thank everyone in the Olympic movement and we will host a wonderful Olympic Games," Prime Minister Shinzo Abe said.
Bid leader Tsunekazu Takeda added: "It is a great honour that Tokyo has been chosen. The first thing I will do when I return is to thank all of Japan."
IOC president Jacques Rogge, who will stand down on Tuesday after 12 years, congratulated Tokyo on its "excellent bid" and "comprehensive" victory.
Delegates from each of the three cities in contention in the final stages faced serious challenges in persuading voters to back their bid.
Madrid failed to persuade the IOC that Spain's profound economic problems would not affect the country's capacity to host the games, despite an impassioned plea from Crown Prince Felipe, an Olympic sailor, who argued that Madrid would host a "sensible, reliable and trustworthy Olympics".
The city dropped out for Istanbul and Tokyo to face off in the final round.
Turkish president Recep Tayyip Erdogan flew straight from the G20 summit in St Petersburg to argue Istanbul's case to host a games that would unite east and west, but failed to overcome anxieties about social unrest in the country, which was recently rocked by mass demonstrations against the government, as well as the jailing of opposition activists and the proximity of the civil war in Syria.
Ultimately, Japan persuaded the IOC that it had the economic and social stability to host the games, and their bid even featured an appearance from Princess Takamado, who for reasons of protocol rarely leaves the country.
In his speech to delegates, Abe sought to reassure the IOC after fresh reports of radiation leaks at the devastated Fukushima plant.
"I ask you read through the headlines and appraise the true situation," he said. "There have been no health-related problems, nor will there be in the future. I shall take responsibility."
The Japanese argued that sport had played a key role in rebuilding the country after the 2011 tsunami, and that hosting the games would allow them to repay the world for its help.
Paralympic long jumper Mami Sato, whose home town was hit by the tsunami, described the power of sport to inspire. Sato, who lost her right leg to cancer at 19, described how 200 athletes visited thousands of children in areas affected by the tsunami. "What we have seen is the impact of the Olympic values as never before in Japan. And what the country has witnessed is that those precious values - excellence, friendship and respect - can be so much more than just words," she said.