In a landmark ruling for gay rights activists, Namibia’s law banning gay sex between men has been ruled unconstitutional.
Colonial-era crimes of “sodomy” and “unnatural sex” were rare but fueled discrimination against gay men who lived in fear of arrest.
Namibia has no laws prohibiting sex between women.
Same-sex marriage remains illegal in the southern African country.
But if a same-sex couple marries abroad and one of them is not a Namibian citizen, their union will be legally recognized.
After Friday’s verdict was read out at the High Court in the capital, Windhoek, supporters LGBTQ group Equality Namibia shares photos of people embracing in court.
“Welcome to the new Namibia. A Namibia born free,” the group said on social media.
The term “born free” is most famous in neighboring South Africa, where it is used to describe the first generation of children who grew up in the dawn of democracy after the end of white minority rule in 1994.
The case was brought by Namibian activist Friedel Dausab with support from the British charity Human Dignity Trust.
“Love is no longer a crime,” Mr Dausab said in reaction to the verdict. “I no longer feel like a criminal on the run in my own country just because of who I am.”
Summing up his emotions, he told Reuters he was “just happy”.
The United Nations also praised the ruling, calling it a “powerful step” towards a more inclusive country that would also improve access to health services and HIV treatment.
Fearing a backlash to the ruling, rights group Amnesty International urged the Namibian government to ensure the safety and dignity of LGBTQ people.
It said it had documented instances of “shocking” and “threatening” rhetoric in the country before the case was heard in court.
Originally a German colony, Namibia gained independence from South Africa in 1990 after a protracted war.
Several countries in Africa have repealed anti-LGBTQ laws in recent years, but South Africa is the only country where same-sex couples can marry and adopt.