BUDAPEST, Hungary -- 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 citywide 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.

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, Mayor Istvan Tarlos said he would wait for the government's official position before getting involved in the debate.

"Everything that is going on is no longer about sports," 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 Budapest assembly withdrew the city's bid to host the 2024 Summer Olympics, leaving Los Angeles and Paris as the final cities contending for the Games. William Stevens/Gamma-Rapho/Getty Images

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. Other opposition parties helped collect the signatures, far more than the 138,000 minimum needed.

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. IOC president Thomas Bach said last week that the committee would review its bid process because it now produces "too many losers," which has fueled speculation that Los Angeles and Paris could both get hosting rights for either the 2024 or 2028 Olympics.