Student protesters hurl objects as they are sprayed by a police water cannon truck during a protest outside the parliament in Jakarta, Indonesia, on September 24, 2019.
CNN  — 

Thousands of student protesters have taken to the streets of Indonesia to oppose a controversial draft criminal code that would make consensual sex outside of marriage illegal and a new law that could weaken anti-corruption efforts.

On Tuesday – the second consecutive day of mass demonstrations in the capital – protesters gathered outside the parliament building in the country’s capital Jakarta to demand the government withdraw the draft code. Pictures from the rally show large crowds of mostly young protesters setting bonfires on the street and waving banners.

An estimated 18,000 police were dispatched to guard the Parliament Building, state media reported. Police later fired tear gas and deployed water cannons to disperse the crowds.

University students across the country staged similar protests. In the province of South Sulawesi, demonstrations became chaotic as police fired tear gas and beat students with clubs, according to state media.

Student protesters throw stones at riot police as a gate burns in the background during a protest outside the parliament in Jakarta, Indonesia, on September 24, 2019.

The proposed penal code, if passed, would usher in a raft of sweeping new laws. In addition to effectively outlawing same-sex relations, and penalties for insulting the president, the law would also impose a possible jail sentence for anyone who helped a woman terminate her pregnancy.

The bill has been widely criticized by rights groups as a violation of basic freedoms, with Human Rights Watch describing it as “disastrous not only for women and religious and gender minorities, but for all Indonesians.”

Protesters are also demanding that the government repeal a controversial new law passed last week that critics allege will weaken the independence of the nation’s main anti-corruption agency, the Corruption Eradication Commission, known as the KPK.

The new law means that the country’s anti-graft body Corruption Eradication Commission is no longer an independent state body, but instead operates under the government, according to Antara News.

On Tuesday, the Indonesian Parliament decided to postpone passing the new penal code, meaning it will likely be delayed until the next Parliament session, according to the Speaker of the House Bambang Soesatyo.

But it could only be delayed for a week as Indonesia’s new Parliament will be sworn in at the start of next month.

How the law changes are connected

Indonesia is the world’s largest Muslim-majority country, but prides itself on being a tolerant nation with a diverse mix of ethnicities and religions. But there has been a rising intolerance in the country against religious and sexual minorities from increasingly assertive religious conservatives.

Riot police face off with protesters in Makassar, Sulawesi on September 24, 2019, as demonstrations in Jakarta and other cities take place for a second day in a row against the government's proposed change to its criminal code laws.

The protests are illustrative of a growing distrust between members of the public and the authorities, Human Rights Watch Indonesia researcher Andreas Harsono told CNN.

The country’s anti-graft body has previously targeted high-profile politicians and business people, said Harsono. A change to its status has led to fears that the country’s elite want to take the country’s wealth for themselves.

Many protesters believe that the amendment to the penal code is part of a wider attempt to suppress criticism, especially from non-governmental organizations and environmentalists, said Harsono.

The new penal code had been expected to pass into law as early as this week, but on Friday, Indonesian President Joko Widodo announced he would postpone a vote on the code after outcry from human rights groups worldwide.

Indonesian riot police fire tear gas to disperse student protesters during a clash outside parliament in Jakarta, Indonesia, on September 24, 2019.

Parts of the code needed “in-depth study,” he said. He has ordered his Law and Human Rights Minister to gather public feedback.

The proposed new criminal code has been in the making for decades. Indonesia’s Minister of Law and Human Rights Yasonna Laoly, who reintroduced the bill in 2015, told CNN last week that the law was intended to replace the 100-year-old Dutch colonial-era penal code and would make Indonesia’s criminal law more in line with how Indonesians live today.

CNN’s Angus Watson and Helen Regan contributed to this story.