Mozambique has decriminalised homosexuality in its new penal code, making it one of a few African countries where same-sex relationships are legal.
The revised code, in force from Wednesday, drops a colonial-era clause outlawing “vices against nature”.
There were no prosecutions under that clause but rights activists have said this change is a symbolic victory.
They add that this could set an example for the rest of the continent.
“I am sure that African countries will look at their old laws and see that this is an important step to guarantee that society is free and equal,” Danilo Da Silva, head of the Mozambican gay rights group Lambda, told the BBC.
Historically Mozambique has seen little violence towards gay and lesbian people, BBC Mozambique analyst Zenaida Machado says.
But, she adds, same-sex relationships are still a divisive subject in a country where most people are either religious Christians or Muslims.
While people may be relaxed about homosexuality, many see promoting gay rights as an attack on cultural and religious practices.