In a landmark ruling, the High Court of the African nation of Botswana has overturned the country’s archaic law that criminalized consensual same-sex relations.

The court ruled unanimously on Tuesday that the legislation, dating back to colonial times, was unconstitutional, discriminatory and against the public interest. “A democratic society is one that embraces tolerance, diversity and open-mindedness,” said Justice Michael Leburu. “Societal inclusion is central to ending poverty and fostering shared prosperity.” This ruling is a victory for the continent, coming a month after Kenya’s high court decided to uphold their country’s laws criminalizing homosexuality.

Botswana’s Penal Code previously stated that “carnal knowledge of any person against the order of nature,” such as same-sex relations, could be punished by up to seven years in prison. The Code also stated that “acts of gross indecency,” both public and private, were punishable by up to two years in prison. In March, Letsweletse Motshidiemang, a student at the University of Botswana, brought the case to court, arguing that due to societal changes, homosexuality more widely accepted and the laws should be changed to reflect that.

SLIDESHOW: TOP DEMOCRATS RUNNING FOR PRESIDENT IN 2020

While the country still doesn’t allow gay marriage, the decriminalization of consensual same-sex relations is a big step forward for the region, and many hope that it will serve as an example for other countries in Africa. Neela Ghoshal, a researcher for Human Rights Watch, said that the ruling provided a “powerful precedent on the continent by recognizing that the criminalization of same-sex conduct violates privacy rights and is blatantly discriminatory.”

In much of Africa, it is still illegal to be gay, with South Africa being the only country on the continent to recognize same-sex marriage. In other parts of the landmass, not only is it a crime to have homosexual intercourse but in many countries the punishment for those crimes is death. As LGBTQ activists have made recent advancements in places like Taiwan, Hong Kong and now Botswana, many hope that a new wave of LGBTQ support is growing, helping to create a more accepting world.