Indonesian police fired tear gas and water cannon to disperse thousands of rock-throwing students protesting a new law they said had crippled Indonesia's anti-corruption agency.

Key points: Violence escalated as thousands of students protested against a raft of conservative new laws in Indonesia

Violence escalated as thousands of students protested against a raft of conservative new laws in Indonesia Demonstrators set fire to toll gates and police posts around the country, prompting retaliation

Demonstrators set fire to toll gates and police posts around the country, prompting retaliation The wave of unrest underscores Indonesia's challenge in changing its graft-ridden image

Tens of thousands of students rallied in cities all over Indonesia yesterday against a law passed by Parliament last week that reduced the authority of the Corruption Eradication Commission, a key body in fighting endemic graft in the country.

The students are also enraged over the Government's attempts to pass a new criminal code that would criminalise sex outside marriage and abortions, and making it illegal to insult the President, religion and state institutions.

President Joko Widodo postponed a vote on the latter bill last week, however some politicians have said they would try to come up with a new draft to bring it to a vote before their current term ended at the end of this month.

As the demonstrations have swollen over the past two days, violence has also escalated in some cities.

Last night's protests saw demonstrators set fire to tyres, toll gates and a police post in Jakarta.

Protests have swollen over the last two days, with students spilling onto the streets outside Jakarta's Parliament. ( Reuters: Willy Kurniawan )

One banner held by a woman in a photo posted on social media read: "My crotch does not belong to the Government."

Thousands gathered in the front and back entrances to Jakarta's parliament building, demanding to meet with Speaker Bambang Soesatyo.

Mr Soesatyo held a news conference inside the building urging calm, but refused to answer questions from reporters on whether the vote would be delayed until a new parliament took office, repeating that the vote could happen in the current term.

Police then fired water cannon and tear gas in an attempt to disperse the crowd.

They also fired tear gas to disperse thousands of protesters in Bandung, West Java, where rocks were hurled at officers near a local parliament building.

Clashes between protesters and police also occurred in other cities, including Makassar, Yogyakarta, Malang, Palembang and Medan.

On the main street through the capital Jakarta, hundreds of others were marching down towards Parliament after protesting in front of the presidential palace, blocking traffic.

"The criminal code doesn't side with the people," Fuad Wahyudin, a 21-year-old student from an Islamic university in West Java, said.

"We're going to Parliament to oppose the new law for the anti-corruption agency that are not pro-people but are pro-corruptors," he said

The wave of unrest underscores Indonesia's challenge in changing its graft-ridden image and has threatened the credibility of Mr Widodo, who recently won a second term after campaigning for clean governance.

He faced down riots in May by supporters of the losing candidate, former General Prabowo Subianto, but those events were seen as partisan politics, with limited support.

The new protests are not associated with a particular party or group, and instead are led by students, who historically have been a driving force of political change in Indonesia — their mass demonstrations in 1998 triggered events that led the country's longtime strongman leader, Suharto, to step down.

Hundreds of officials from various branches of government have been arrested since the independent anti-graft commission was established in 2002 as part of people's demands during a reform movement following Suharto's ousting.

Those demonstrating this week are demanding that Mr Widodo issue a government regulation replacing the new law on the corruption commission, known by its Indonesian abbreviation, KPK.

Corruption is endemic in Indonesia and the anti-graft commission, one of the few effective institutions in the country of nearly 270 million people, is frequently under attack by lawmakers who want to reduce its powers.

"We reject the bill on KPK being forced into law," a speaker told a cheering crowd in front of the parliament building yesterday.

"Corrupters tried to manipulate us this way, it's the poor that are going to suffer most."

Activists say the revision weakens the powers of one of the most credible public institutions in Indonesia and reduces its independence, with investigators becoming civil servants who would need to be seconded from state bodies, including the police.

Under the proposed laws, there would be a four-year prison term for women who have an abortion. ( ABC: Archicco Guiliano )

The anti-corruption watchdog Indonesia Corruption Watch accused lawmakers of moving to protect themselves after the commission named 23 sitting members of Parliament as corruption suspects.

It said in a statement on Tuesday that the new law lengthened bureaucratic procedures needed for anti-graft investigators to wiretap potential suspects, which they fear would significantly hamper KPK's work.

Indonesia, South-East Asia's largest economy, ranked 89th out of 175 countries in the 2018 Corruption Perceptions Index reported by Transparency International.

AP/Reuters