Tokyo was selected as host of the 2020 Summer Olympics, setting off a celebration at dawn Sunday in a nation fighting off two decades of deflation and still recovering from a nuclear disaster.

The Japanese capital easily beat out Istanbul and Madrid in an International Olympic Committee vote, having portrayed itself as the safer choice amid turmoil in the Middle East and runaway unemployment in parts of Europe.

After two rounds of voting at a hotel ballroom in Buenos Aires, IOC President Jacques Rogge walked to a podium and opened a white envelope. His announcement — “Tokyo” — was drowned out by a howl of celebration when it was broadcast live to a city of partiers. “Tokyo!” several thousand chanted at an outdoor viewing party as gold tinsel rained down. “Tokyo!” hoarse twentysomethings screamed as they stumbled out of bars and toward the subway.

Tokyo has hosted international events before, including the Olympics in 1964 and the World Cup — co-hosted with South Korea — in 2002. But this latest milestone comes at a particularly critical time as Japan’s population grays and shrinks and its younger generations grow more pessimistic and withdrawn.

“These Games can be a turning point for Japan,” venture capitalist Yoshito Hori said at one early-morning viewing party, an Olympics-logo towel draped around his neck. “As a nation, we tend to underestimate ourselves — and we’ve lost confidence. This can be a chance to regain it.”

Tokyo defeated Istanbul in the final vote by a 60-36 margin after Madrid was eliminated in the first round. Turkey’s largest city has never hosted an international sporting event of such magnitude — no World Cups, no Olympics — but was pursuing the Olympics for the fifth consecutive time. Organizers hoped to bring the Games to a Muslim-majority nation for the first time. The bid could have been hindered, in the minds of some of the IOC members, by the current strife in Syria, which borders Turkey to the south.

Istanbul’s bid survived Saturday’s first round of voting, which eliminated Madrid. The Spanish city was bidding for the third straight time and pitched itself as the most prepared of the three cities to host the 2020 Games, with most of its infrastructure already in place. But Europe will have hosted two recent Olympics — the 2012 Summer Games in London and February’s Winter Games in Sochi, Russia.

Tokyo is one of the world’s most dense megacities and certainly its tidiest, famous for its neon signs, six-seat sake bars and punctual trains. In their pitch to IOC voters, Tokyo’s organizers touted their city’s modern infrastructure and transportation system, as well as its low crime rate. “A very low-risk Games,” they described it in documents submitted to the IOC.

But Japanese officials in recent weeks also faced scrutiny about the ongoing leaks of toxic water into the ocean at the coastal Fukushima Daiichi nuclear plant, where three reactors melted down in March 2011. Engineers have so far failed to contain the problem, prompting the government last week to pledge $500 million for new work at the facility, including a subterranean “ice wall” that, if effective, will cut off the flow of groundwater around key buildings.

Hours before the IOC vote, Japanese Prime Minister Shinzo Abe, speaking in Buenos Aires, said the situation at the Fukushima plant is “under control” and “will never do any damage to Tokyo,” 150 miles away. Officials claim that contamination is limited to an area of several hundred yards around the plant, but they face public skepticism both in Japan and beyond, having repeatedly downplayed concerns only to admit to them later.

“Tokyo 2020 will offer guaranteed delivery,” Abe said.

Tokyo’s selection sets it up for years of construction — and spending. Japan will build or refurbish more than two dozen venues, costing upward of $5 billion. More than a quarter of that will be spent on a new Olympic stadium, an 80,000-seat venue that looks like an aerodynamic bicycle helmet.

“All cities — not just in Japan but globally — are competing against one another,” said Hiroo Mori, executive vice president of Mori Building Co., a development company. “Tokyo has a chance to get ahead. The infrastructure. The construction. The way people look at the future.”

When Tokyo last hosted the Games in 1964, Japan was at the starting point of a boom as it transformed from war-torn poverty into an economic powerhouse. Only eight years earlier Japan had become a member of the United Nations. Sony wasn’t yet producing color televisions, and Toyota was still two years from launching the Corolla.

In advance of those games, the city furiously built subway lines and roads and improved its sewage system. The Opening Ceremonies took place in an ovular stadium, where celebrants released 8,000 pigeons and 12,000 colored balloons into the sky. Abe, in his address to voters in Buenos Aires, said he could still recall “vivid scenes” from that day.

“High up in the deep blue sky, five jet planes making the Olympic rings,” he said. “All amazing to me, only 10 years old.”

“We in Japan learned that sports connect the world,” Abe continued. “And sports give an equal chance to everyone.”

Svrluga reported from Washington.