Indonesian president-elect Joko Widodo accused his opponents of rolling back democracy after parliament voted to scrap direct elections of local officials, a move likely to hinder his ambitious reform agenda.

The outgoing legislature voted early Friday to scrap the local polls, a heavy blow for Widodo, who rose to power through the system and whose party had campaigned against the proposal.

The new law takes away the people's right to choose mayors, provincial governors and district heads across the archipelago, and instead hands power to local parliaments to pick them.

While opponents of the current system argued that holding so many elections was hugely costly and often caused conflicts, supporters said that doing away with the polls would be a setback for democracy and a return to a system used during the time of dictator Suharto, toppled in 1998.

The move to abolish the elections, which have been used for the past decade, was seen as revenge by political opponents of Widodo, known by his nickname Jokowi. He started his career by winning direct election as a mayor before securing the presidency in July.

Parties that backed his rival, ex-general Prabowo Subianto, and have a majority in parliament provided support for the bill.

There had been much opposition to the plan and Widodo, a former furniture exporter from a humble background, sought on Friday to appeal to the large sections of the public who were disappointed.

"The public can see which parties have taken away people's political rights. Take note," he told reporters in the capital Jakarta.

Pro-democracy groups said they planned to challenge the move at the Constitutional Court and some analysts predict that the judges would overturn the parliament's decision.

Huge step back

Tobias Basuki, an analyst from Jakarta-based think-tank the Centre for Strategic and International Studies, said that if the law did remain in force, it would be a "huge, huge step back" for Indonesia's young democracy.

In the coming years there would be an increase in "political horse-trading" and corruption in local parliaments as MPs make closed-door deals on who to pick as local leader, he predicted.

It would reduce the public's interest in the political process and put a halt to new-style leaders from outside the political and military elites, such as Widodo, winning office, he added.

"Joko Widodo was a result of this system," Basuki said, and pointed towards other popular local leaders who have come to power through direct elections, such as Tri Rismaharini, the mayor of Surabaya, Indonesia's second-biggest city.

Observers also said the defeat is a bad start for Widodo, who will be inaugurated on October 20, as he will need to win support in parliament in future to push through reforms aimed at reviving a slowing economy and strengthening the country's welfare system.

"It is very possible that future policies put forward by the government will receive a similar response," Titi Anggraini, executive director of pro-democracy group Perludem, which opposed the bill, told AFP.

Analyst Helmi Arman from Citigroup added: "It may dim market expectations on the reform outlook."

The Jakarta stock market was down 1.6 percent in afternoon trade, as investors fretted about Widodo's ability to enact much needed reforms in Southeast Asia's top economy following the parliamentary defeat.

Many took to social media to vent their fury, with much anger directed at outgoing President Susilo Bambang Yudhoyono and his ruling Democratic Party.

Yudhoyono had asked his large bloc of lawmakers to oppose the bill -- but they ended up walking out of the session after their demands were not met, depriving opponents of the votes needed to maintain direct elections.

The president, on a visit to the United States, said he was "disappointed" at the outcome.

However many accused him of being insincere in his support for direct elections and "#ShameOnYouSBY" become one of the top topics trending on Twitter, referring to Yudhoyono by his initials.

"#ShameOnYouSBY for letting our democracy move backwards during YOUR watch. How's that for your legacy?" tweeted Ima Abdulrahim.