Indonesia's parliament has voted to scrap the direct elections of local officials in what critics say is a blow to the country's democracy.

The bill is supported by a coalition of parties whose candidate was narrowly defeated in July's presidential elections.

Direct elections for mayors, regents and governors began in 2005 as part of Indonesia's democratic transition after 1998 fall of Suharto dictatorship.

The bill which is passed early Friday stipulates they will now be chosen by the local parliaments as they were prior to 2005.

The vote represents an early defeat for President-elect Joko Widodo, whose party had voted against any changes in the electoral process.

The coalition of losing candidate Prabowo Subianto has a majority of seats in the national parliament and has vowed to disrupt Widodo's presidency.