Botswana's Court of Appeal on Monday upheld a ruling that decriminalized gay sex in the southern African nation.

The nation's High Court in 2019 unanimously ruled that criminalization violated the constitutional rights of people who identify as LGBT.

The Botswana government appealed the decision.

Five justices unanimously disagreed with the government, saying that the nation's law “violated the right to privacy … the right to liberty, security of person and equal protection under the law … and the right to freedom from discrimination” under the nation's constitution.

Before the 2019 ruling, gay sex in Botswana was punishable by up to seven years in prison.

Reuters reported that LGBT rights activists at the court cheered the decision.

“This will forever change the landscape of democracy, human rights and equality in Botswana,” Sethunya Mosime of the Lesbians, Gays, and Bisexuals of Botswana (LEGABIBO) is quoted as saying by Reuters.

“This case has tested Botswana democracy and independence of judiciary. We can strongly say Botswana is a true democracy,” Mosime added.