Indonesian leader Joko Widodo ordered a probe on Friday after a second student protester died from injuries sustained during a wave of nationwide demonstrations against divisive legal reforms, including banning pre-marital sex and weakening the anti-graft agency.

The 19-year-old engineering student died of blunt-force head injuries during riots that erupted in Kendari city on Sulawesi island on Thursday, according to the local hospital director.

The precise circumstances surrounding his death were not clear.

On Friday, police confirmed that the first victim in Kendari was shot dead, while insisting that officers were not equipped with live ammunition.

Widodo ordered a probe into the students’ deaths, as he faces a key test weeks before kicking off a second term.

“Since the very start I have instructed the chief of police and his staff not to act excessively,” the 58-year-old said on Friday.

The students’ deaths come after days of pitched street battles across the Southeast Asian nation that have left hundreds injured and sparked calls for a probe into allegations of police brutality.

The unrest was fuelled by a proposed bill that includes dozens of legal changes – from criminalising pre-marital sex and restricting contraceptive sales, to making it illegal to insult the president and toughening the Muslim-majority country’s blasphemy law.

Passage of the reforms has now been delayed.

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

The demonstrations are among the biggest since mass street protests in 1998 brought down the Suharto dictatorship and ushered in what is now the world’s third-biggest democracy.

“These very sudden and forceful demonstrations nationwide… make clear that any moves by (Widodo) to unwind democratic freedoms will face resistance in the streets by the same segment of society that kickstarted reforms in 1998,” said political risk analyst Kevin O’Rourke.

“Students have sent a firm message that reform matters.”

In Jakarta, a few hundred students gathered near parliament on Friday to demand that the legal overhaul be scrapped and called for justice in the Kendari students’ deaths.

“We demand that the (local) police chief be sacked for failing to safeguard democracy,” said Najih Prasetyo, a protest organiser.

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

Widodo’s administration sought to portray the protests as being hijacked by agitators aiming to disrupt the government – and suggested they were similar to deadly post-election riots that paralysed Jakarta in May.

“Jokowi has never faced a situation as complex as this,” said Arya Fernandes, a political researcher at the Jakarta-based Centre for Strategic and International Studies, using Widodo’s common nickname.

“His leadership abilities are being tested,” he added.

The controversial changes 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, but a renewed push this year, backed by Islamic groups, was met with a wave of criticism.

Meanwhile, police said on Friday that a 22-year-old university student in Kendari died after being shot the previous day, but repeated earlier claims that riot police were not carrying live ammunition.

“Please trust us and give us time to investigate to find out who the perpetrators are,” Southeast Sulawesi police chief Iriyanto, who goes by one name, told reporters. (AFP)