Botswana's government will appeal a high court ruling which decriminalised homosexuality, potentially reviving a law that punished gay sex by up to seven years in prison.
The court's ruling in June, which was praised by international organisations and activists, meant Botswana joined a handful of African countries that have legalised same-sex relationships.
Attorney-General Abraham Keetshabe said in a statement released late on Friday that the high court was mistaken in its conclusion in overturning the colonial-era law.
"I am of the view that the High Court erred in arriving at this conclusion and thus, I have decided to note an appeal with the Court of Appeal," said Keetshabe without giving further details on the grounds for the appeal.
Gay rights group Lesbians, Gays and Bisexuals of Botswana said the appeal was disappointing and affirmed persistent homophobia and transphobia.
"It says to LGBTI the state through its lawyers (attorney general) affirms the homophobic and transphobic laws," the group's policy and legal advocacy manager Caine Youngman said in a statement.
"It suggests that the LGBTI's lives should be determined by the majority which is wrong."
In June, a panel of three judges ruled that sections of the penal code that ban gay sex were unconstitutional as they violated privacy, liberty, and dignity.
The panel ruled the sections were discriminatory and served no public interest.
The case, which had been brought by university student Letsweletse Motshidiemang, argued the government should do away with the law in light of a changed society where homosexuality was more widely accepted.
Same-sex relationships are illegal in more than 70 countries worldwide, almost half of them in Africa where homosexuality is broadly taboo and persecution is rife.
President Mokgweetsi Masisi also signalled his support for same-sex relations in a speech in December, where he said LGBT citizens deserve to have their rights protected.
Botswana is the latest country in Africa to decriminalise same sex relations, with Amnesty saying it follows Angola in January, Seychelles in June 2016, Mozambique in June 2015 and Sao Tome and Principe, and Lesotho in 2012.
South Africa is the only African nation to have legalised gay marriage.