Mozambique is set to become the latest country in Africa to decriminalize homosexuality, breaking away from what was once widely seen as a continentwide tradition of discriminating against gay people. The landmark legislation was scheduled to go into effect June 29 and would make the southeast African nation the 21st country in Africa to legalize same-sex relationships, according to Out.

The country’s penal code has been undergoing an update, and it has taken the government about six months to agree to revise the existing law that provides for “security measures” to be enforced against those “who habitually engage in vices against nature,” according to Gay Star News. Former President Armando Guebuza signed the law in December of last year.

But with the revision of what constitutes a crime in the country, “[t]he new Penal Code sweeps away a great deal of the musty colonial legacy, including the mention of ‘vices against nature,’ ” Agencia de Informaçäo de Moçambique said. “Now not even the most contorted of arguments could claim that acts of gay sex between consenting adults are somehow illegal.”

Mozambique’s leading LGBT organization, which helped pave the way for the law to be enacted, was cautiously optimistic about the social progress being made in the country. “Our primary interest is to precipitate a change in society so that it becomes more favourable to the free expression of sexual orientation and gender identity,” said Lambda.

Once Mozambique’s new laws go into effect, there will still be 35 African countries that deem homosexuality a criminal act. Sudan and Mauritania enforce the death penalty for it. Last month, Malawi, also in southeast Africa, rejected recommendations from the United Nations to decriminalize homosexuality despite 41 state parties pushing to maintain criminilaization, All Africa reported. And last year, Nigeria, Uganda and Gambia passed laws that would create harsher penalties for homosexuality, the Washington Post reported