“Our constitution respects human rights, but when it comes to sexual crimes there is no compromise,” President Widodo said in a new interview with the BBC, adding that the government “will hand out the maximum penalty” for such crimes.

“In my opinion ... chemical castration, if we enforce it consistently, will reduce sex crimes and wipe them out over time,” he said.

Related stories

Video

'I'M IN BIG TROUBLE'

Moment pervert realises '13-year-old girl' he thought he was meeting for sex was group of paedophile vigilantes

BRIT ‘SLAUGHTERS’ ISIS SEX BEAST

SAS hero ‘killed ISIS paedo with AXE to the head as jihadi abused child sex slaves’

CHILD RAPIST UNMASKED

Beast who attacked three little boys and shared films of his sick crimes faces life in prison

Video

'I'VE LOST MY WAY'

Moment pervert tries to destroy his mobile phone when confronted by vigilantes

ON THE HUNT

The decision has sparked anger from human rights activists and the Indonesian Doctors Association, reports News.com.au

“The punishment cannot be done as long as the executor is a medical doctor, because we have to uphold medical ethics. When you become a doctor, you have to swear that you won’t do anything harmful to any human being,” Dr Prijo Sidipratomo, chairman of the medical ethics committee at the Indonesian Doctors Association, told the BBC.

Robert Andrew Fiddes Ellis (right) of Australia waits inside a holding cell before his trial at a court in Denpasar on Indonesia's resort island of Bali

“My message to all doctors across Indonesia is that as long as you’re a doctor, you cannot do it, even if the government says it is to punish a rapist. It is harmful and it’s against human rights.”

Robert Andrew Fiddes Ellis, described as Bali’s worst Australian child sex offender, narrowly avoided the death penalty or chemical castration for molesting 24 children since 2014.

Indonesia is among a small group of places worldwide which use the measure, including Poland and some states in the USA. In 2011 South Korea became the first Asian country to legalise the treatment. Chemical castration involves using drugs to reduce libido and sex drive.

President Widodo was spurred into action after the murder and gang-rape in April of a 14-year-old girl. She was set upon by a gang of drunken men and boys as she walked home from school on the western island of Sumatra.