Indonesia's parliament voted Friday to scrap direct elections for local leaders, despite angry protests against the move and criticism that it will roll back a key democratic reform of the post-Suharto era.
After a heated debate lasting more than 10 hours, 226 lawmakers voted in favour of ending the current system of mayors, provincial governors and district heads being chosen by the public in the world's third-biggest democracy.
Instead, local parliaments will be given the power to pick them, which critics says is a blow to the process of democratisation that was started after the downfall of dictator Suharto in 1998 following three decades of authoritarian rule.
Opponents of the bill lost a huge bloc of support in the final stages of the debate when the ruling Democratic Party, which had been expected to vote against the move, walked out after conditions they had demanded could not be agreed on.
Only 135 lawmakers chose to retain the elections, in a vote which came after pro-democracy activists demonstrated the level of public anger at the plan by burning tyres outside parliament in Jakarta during a noisy protest.
"Democracy in this country has suffered a setback," tweeted Ridwan Kamil, the directly elected mayor of Bandung, a city on the main island of Java.
As well as being seen as an attack on Indonesia's young democracy, critics view the move as revenge by opponents of Joko Widodo, who won the presidency in July and came into politics by being directly elected as a local mayor.
Supporters of the plan argued that the hundreds of polls which have been held across the world's biggest archipelago nation every few years since 2005 are enormously costly and in reality only allow the wealthy to win election.
'A big step back'
However critics saw the move as an elite power grab, and also argued it would increase corruption as would-be leaders may have to strike deals with local MPs to win office.
Widodo, known by his nickname Jokowi, had spoken out against the plan and its victory is a blow as it suggests his new government could face problems in getting crucial legislation through a hostile parliament.
Ahead of the vote, Widodo said abolishing direct elections of local leaders "would be a big step back for democracy".
"Directly elected leaders have a moral obligation to the people. They have to look after the people, because they were chosen by the people," he said.
Up until the final stages of the debate, it was not clear how the vote would go but the shock decision by most MPs from the Democratic Party to walk out ensured victory for those who supported the plan.
Outgoing President Susilo Bambang Yudhoyono had ordered members of his Democrats to vote against the proposal - but divisions quickly appeared in the party.
The bill was pushed by parties that backed Widodo's opponent for the presidency, Prabowo Subianto, an ex-general with a chequered human rights record.
Five parties who had backed Prabowo at the election supported the proposal, and only three were opposed.
While it ends the system of local leaders being picked by the public, it still allows for the election of local legislatures.