Chemical castration could reduce sex crimes and "wipe out" paedophilia in Indonesia, the country's president has said.

Earlier this month, Jakarta introduced harsh new laws including minimum sentences, chemical castratoin and possible execution for paedophiles.

The legislaiton was proposed by the president after the brutal gang rape and murder of a 14-year-old girl.

"Our constitution respects human rights, but when it comes to sexual crimes there is no compromise," President Joko Widodo told the BBC.

"We are strong and we have to be very firm. We will hand out the maximum penalty for sexual crimes. This will not be compromised."

Indonesia to execute 14 drug convicts despite protests

When asked what evidence there is chemical castration works with sex offenders by presenter Yalda Hakim, Mr Widodo said: "In my opinion... chemical castration, if we enforce it consistently, will reduce sex crimes and wipe them out over time."

The law has been criticised by the Indonesian Doctors Association, which said its members would refuse to administer chemical castration as it is a violation of its medical ethics.

"That's fine if doctors don't want to do it," Mr Widodo said.

"We can use other doctors. We could use military doctors."

He added: "There are lots of people who want to do it. That's not a problem."

Bali Nine pair executed Show all 22 1 /22 Bali Nine pair executed Bali Nine pair executed Bali Nine pair due to be executed People attend a vigil for the prisoners to be executed in Indonesia at Martin Place on April 28 Getty Images Bali Nine pair executed Bali Nine pair due to be executed Crosses for condemned drug convicts (from L-R) Australians Andrew Chan (L) and Myuran Sukumaran (C), and Nigerian Okwudili Oyatanze AFP/Getty Images Bali Nine pair executed Bali Nine pair due to be executed Brintha Sukumaran, a sister of Australian death row prisoner Myuran Sukumaran's screams as she arrives to see him for a final time Getty Images Bali Nine pair executed Bali Nine pair due to be executed Brintha Sukumaran, the sister of Myuran Sukumaran, cries during her final visit to see him in prison on 28 April AP Bali Nine pair executed Bali Nine pair due to be executed Michael Chan, brother of Australian drug convict and death row prisoner Andrew Chan, arrives at Nusakambangan island on 28 April AFP/Getty Images Bali Nine pair executed Bali Nine pair due to be executed The back of a painting by Australian death-row prisoner Myuran Sukumaran is shown, signed by the eight other condemned people EPA Bali Nine pair executed Bali Nine pair due to be executed A lawyer carries a painting by Myuran Sukumaran at Wijayapura port in Cilacap on 28 April Getty Images Bali Nine pair executed Bali Nine pair due to be executed A woman places a tribute on a flower wall that reads '#keephopealive' as part of an Amnesty international vigil for the pair Bali Nine pair executed Bali Nine pair due to be executed People at a vigil in Sydney on 27 April against the execution of Australians Andrew Chan and Myuran Sukumaran Amnesty International/Sitthixay Ditthavong. Bali Nine pair executed Bali Nine pair due to be executed Activists hold a banner during a protest in front of the Indonesian embassy in Manila on April 27, 2015 AFP/Getty Images Bali Nine pair executed Bali Nine pair due to be executed The lawyer for Australian death row inmates Myuran Sukumaran carries a painting after visiting Indonesia's Nusakambangan island on April 26 AFP/Getty Images Bali Nine pair executed Bali Nine pair due to be executed A lawyer carries a self-portrait drawn by Myuran Sukumaran after visiting the prison island of Nusakambangan on 27 April AP Bali Nine pair executed Bali Nine pair due to be executed Workers load coffins into a lorry ahead of the execution of nine prisoners in Indonesia Getty Images Bali Nine pair executed Bali Nine pair due to be executed Indonesian soldiers stand as guard at Wijayapura port near the prison island of Nusa Kambangan on Monday Reuters Bali Nine pair executed Bali Nine pair due to be executed Chintu Sukumaran (L), brother of Myuran Sukumaran, stands next to Michael Chan, brother of Andrew Chan in Indonesia on 26 April, 2015 Reuters Bali Nine pair executed Bali Nine pair due to be executed Raji Sukumaran (R) and Brintha Sukumaran (L) family members of death-row prisoner Myuran Sukumaran cries as they talks to media after visiting Myuran at Kerobokan Prison in Bali, Indonesia EPA/MADE NAGI Bali Nine pair executed Bali Nine pair due to be executed Indonesian police stand guard as the Bali Nine duo Andrew Chan and Myuran Sukumaran arrive at Wijaya Pura Port where they will be transferred to Nusa Kambangan prison ahead of their execution in Cilacap, Central Java, Indonesia Getty Bali Nine pair executed Bali Nine pair due to be executed Halen Chan, the mother of death-row prisoner Andrew Chan, wipes away tears during a press conference in Jakarta, Indonesia EPA/MAST IRHAM Bali Nine pair executed Bali Nine pair due to be executed Andrew Chan, right, and Myuran Sukumaran, centre, talking to their lawyer EPA Bali Nine pair executed Bali Nine pair due to be executed Andrew Chan and Myuran Sukumaran, the two members of the Bali nine who could be executed within days, appear at court in 2006 Jason Childs/Getty Images Bali Nine pair executed Bali Nine pair due to be executed Two Australian drug traffickers Andrew Chan (L) and Myuran Sukumaran (R) were sentenced as the ringleaders of the "Bali Nine" drug ring in 2006 JEWEL SAMAD/AFP/Getty Images Bali Nine pair executed Bali Nine pair due to be executed Myuran Sukumaran is due to be executed EPA

He said if the court hands out the punishment of chemical castration, then "we will carry it out," saying military doctors or government doctors could carry out the procedure.

Chemical castration of paedophiles is already practiced in several countries, including Poland, Turkey, South Korea, Russia and some parts of the US.