Botswana's government will appeal a high court ruling that decriminalised homosexuality, potentially resuscitating a law that punished gay sex by up to seven years in prison.
Last month's landmark court ruling, which was praised by international organisations and activists, meant Botswana joined a handful of African countries that have legalised same-sex relationships.
But Attorney General Abraham Keetshabe said in a statement 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," Keetshabe said, without giving further details of the grounds for the appeal.
In June, a panel of three judges ruled that sections of the penal code banning gay sex were unconstitutional as they violate privacy, liberty, and dignity. It also found the ban to be discriminatory and not to serve the public interest.
The case, which was brought by university student Letsweletse Motshidiemang, argued that the government should scrap the law to reflect 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 remains largely taboo and persecution is rife.
Gay rights group Lesbians, Gays and Bisexuals of Botswana (LEGABIBO), 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. It suggests that the LGBTI's lives should be determined by the majority which is wrong," the group's policy and legal advocacy manager Caine Youngman said in a statement.
Botswana's ruling came after Kenya's high court upheld a law banning gay sex, keeping same-sex relations punishable by 14 years in jail, drawing strong criticism from the United Nations and rights activists.
Previous rulings in Botswana had partially acknowledged the rights of lesbian, gay, bisexual and transgender people in the southern African country, including their right to equal protection before the law.
President Mokgweetsi Masisi also signalled his support for same-sex couples in a speech in December, where he said LGBT citizens deserved to have their rights protected.
Botswana became the latest in a series of African countries to decriminalise gay sex, with rights group Amnesty International saying it followed 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.