The tiny Pacific island nation of Nauru has legalized homosexuality, replacing its century-old criminal code with a new law that also criminalizes slavery and broadens the definition of rape to apply to married and unmarried couples.

In addition, the Crimes Act 2016 decriminalizes suicide, which became an issue after refugees deported from Australia to a controversial Nauru detention center committed or attempted suicide.

Nauru announced on Friday that the Crimes Act 2016 would replace the Nauruan Criminal Code of 1899. The government's decision to decriminalize homosexuality and suicide — in compliance with obligations under international treaties — showed "progressive leadership," it said.