Botswana's High Court has ruled in favor of decriminalizing homosexuality and rejected laws that impose up to seven years in prison for same-sex relationships, citing that the laws were unconstitutional.

According to the New York Times, an anonymous plaintiff challenged the anti-sodomy laws last year. In a written statement read by the applicant’s lawyers in court, L.M. said, “We are not looking for people to agree with homosexuality but to be tolerant.”

A lawyer for the government then argued that the law should not be overturned because it reflects the values of Botswana’s society, but on Tuesday, three judges voted unanimously to revoke the laws.

Judge Elburu called the laws banning gay sex as "discriminatory" adding that: "Sexual orientation is not a fashion statement. It is an important attribute of one's personality."

"A democratic society is one that embraces tolerance, diversity and open-mindedness," Elburu said. "Societal inclusion is central to ending poverty and fostering shared prosperity," he said.

The landmark ruling comes just a month after Kenya's high court upheld its laws criminalizing homosexuality.

Neela Ghoshal, a senior researcher for Human Rights Watch, told CNN that the ruling sets a "powerful precedent on the continent by recognizing that the criminalization of same-sex conduct violates privacy rights and is blatantly discriminatory."

"The High Court is right in declaring that sodomy laws belong in a museum or the archives, not in modern life," she said.

Homosexuality is currently outlawed in 31 out of 54 African countries, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA).