Budapest's assembly approved a motion Wednesday to withdraw the city's bid for the 2024 Olympics.
The decision leaves Los Angeles and Paris as the only remaining candidates. The International Olympic Committee will choose the host city in September.
Budapest's decision to withdraw came after a new political group appeared to have successfully gathered enough signatures to force a city-wide referendum on the bid. Prime Minister Viktor Orban's government said the change of heart by opposition politicians who earlier supported the bid had shattered consensus on the issue.
The withdrawal of the bid was decided with 22 votes in favor and six against, with support coming mostly from councilors from Orban's governing Fidesz party.
U.S. & World
News from around the country and around the globe
"Everything that is going on is no longer about sports," Mayor Istvan Tarlos said during a heated debate at the extraordinary session of the assembly. "The saddest thing ... is what kind of image the country is creating itself abroad with this circus surrounding the Olympics."
The opposition said the city government was letting down voters by preventing them from expressing their opinions about the bid.
"If over a quarter of a million Budapest citizens have determined that they want to decide in a referendum about the Olympics, it is only right if we give them this opportunity," said Antal Csardi of the Politics Can Be Different party.
The Momentum Movement, a new political association, gathered more than 266,000 signatures in 30 days in favor of holding a vote. Some of the other opposition parties helped collect the signatures, far more than the 138,000 minimum needed.
The opposition also criticized the government for apparently reneging on its promise to carry out the Olympic-related infrastructure developments even if the city did not win the bid.
Despite comments from Orban's chief of staff that the money originally earmarked for the Olympics could be spent on rural projects instead, Tarlos said he would wait for the government's official position before getting involved in the debate.
Political analysts said holding the referendum and keeping the issue on the agenda for months did not favor Orban's plans to seek a fourth term in elections scheduled for April 2018.
Hamburg, in 2015, and Rome last year also withdrew their bids. The IOC reiterated last week it would review its bid process because it now produces "too many losers."