Botswana's High Court on Tuesday overturned colonial-era laws that made gay sex illegal. Botswana is the fourth African country to decriminalize homosexual relations, and the first to do so through the courts.
Addressing the court Tuesday, Judge Michael Leburu said Botswana needed to embrace diversity and promote tolerance.
Letsweletse Motshidiemang, a 24-year-old university student, had challenged two of the southern African country's colonial-era laws.
The laws, though rarely enforced, made gay sex punishable by up to seven years in prison.
Motshidiemang's lawyer, Tshiamo Rantao, hailed the judgment.
"There shall be no discrimination based on sexual orientation from now henceforth," he said. "The parliament had already done so when it prohibited discrimination in the employment arena, on the basis of sexual orientation. It is a progressive decision; I am sure it will be celebrated all over the world."
Lesbians, Gays and Bisexuals of Botswana (LEGABIBO) spokesperson Cain Youngman said the ruling was a win for equal rights.
"It basically puts us at par with the rest of the community. It was not about asking for any special rights, we were asking to be equal to other Botswana, period," Youngman said.
The case removed Section 164 and 165 of Botswana's penal code, which was similar to anti-gay laws in other former British colonies.
Kenya's high court in May upheld its colonial-era laws against gay sex, dealing a blow to activists' hopes it would lead the expansion of gay rights in Africa.
Botswana gay rights activist Katlego Kolanyane-Kesupile, who underwent gender transformation, said Tuesday's ruling was a victory for everyone.
"I am really happy that Botswana added to its record of upholding human rights provision for each and every citizen," Kolanyane-Kesupile said. "It is not only a victory for LGBT people. We are here to say every single member deserves to be protected unto the laws of the country."
Homosexuality is a crime in the majority of African nations, and discrimination is common.
Botswana joins Angola, Mozambique, and the Seychelles in removing anti-gay laws and is the first to do so through the court system. The others removed the discriminatory laws through parliament or constitutional reform.
While the Botswana high court's ruling is widely seen as a victory for gay rights, South Africa remains the only country on the continent with explicit legal rights based on sexual orientation.