Angola’s parliament approved a new penal code Wednesday that drops provisions widely interpreted to criminalize homosexuality.

The new penal code is Angola’s first since it gained its independence from Portugal in 1975. The prior code contained many holdover provisions from the colonial era, including a ban of “vices against nature,” which was understood to criminalize same-sex relationships symbolically, if not in practice. Human Rights Watch noted that “[w]hile there have been no known prosecutions under the law, provisions like this one curtail the rights and freedoms of lesbian, gay, bisexual and transgender (LGBT) people, subjecting their intimate lives to unwarranted scrutiny.”

The new code also prohibits discrimination based on sexual orientation; violators who refuse to employ or provide services to people based on their sexual orientation could face a prison term of up to two years.

The UN praised the new code and Victor Madrigal-Borloz, the UN Independent Expert on Protection against violence and discrimination based on sexual orientation and gender identity, issued a statement calling on all countries who still criminalize homosexuality to follow Angola’s example and move towards decriminalization.

Angola follows several other African countries who have decriminalized homosexuality in recent years, including fellow former Portuguese colonies Mozambique (in 2015), São Tomé and Príncipe (in 2012), and Cape Verde (in 2004), as well as Seychelles (in 2016). Same-sex activity and relationships remain illegal in some of Africa’s most populous countries including Sudan, Uganda, and Nigeria.