The unrest was sparked by a proposed bill that includes dozens of law changes -- from criminalising pre-marital sex and restricting sales of contraceptives, to making it illegal to insult the president.

Officials said Thursday hundreds of students were arrested after a night of street battles in downtown Jakarta between molotov-cocktail throwing protesters and riot police.

Police shot tear gas into crowds of mostly high schoolers in the centre of the capital, while a mass of students stormed and occupied the local parliament building in Padang city on Sumatra island.

Fresh rallies were expected Thursday as people began gathering in Jakarta and Sumatra's Aceh province.

The demonstrations across the Southeast Asian archipelago are among the biggest since mass street protests in 1998 brought down the three-decade Suharto dictatorship.

There has also been a backlash against a separate bill that critics fear would dilute the powers of Indonesia's corruption-fighting agency -- known as the KPK -- including its ability to wire-tap graft suspects.

Police said more than 500 protesters were arrested following the Jakarta skirmishes on Wednesday that saw a police post set ablaze.

"Most have since been picked up (by relatives) and gone home," Jakarta police spokesman Argo Yuwono told reporters.

Some were still being held after police found knives and other sharp weapons in their possession, he added.

Students have issued a list of demands including scrapping some of the criminal-code changes, withdrawing troops from Indonesia's unrest-hit Papua region, and halting forest fires in Sumatra and Borneo that have unleashed toxic haze across Southeast Asia.

A vote on the criminal code bill was originally scheduled for Tuesday, but President Joko Widodo has called for a delay in passing controversial changes that could affect millions of Indonesians, including gay and heterosexual couples who might face jail for having sex outside wedlock, or having an affair.

Updating Indonesia's Dutch colonial-era criminal code has been debated for decades and appeared set to pass in 2018 before momentum fizzled out.

A renewed push this year, backed by Islamic groups, was met with a wave of criticism over what many saw as a draconian law that invaded the bedrooms of a nation with some 260 million people -- the fourth most populous on Earth.