Botswana's government will appeal a June high court ruling that decriminalised homosexuality, the attorney-general said on Friday.
Abraham Keetshabe, the government's chief legal advisor, said he would take the case to the court of appeals after reading the 132-page ruling of the high court, which he said had "erred in arriving at (its) conclusion".
Under Botswana's 1965 penal code, homosexuality is punishable by a jail term of up to seven years.
But high court judge Michael Elburu ordered the laws be amended in a June 11 ruling that was widely hailed.
"We say the time has come that private, same sexuality must be decriminalised," Elburu said. "It is a variety of human sexuality."
The judge's ruling was welcomed by the UN agency UNAIDS, the United States, and rights groups.
In May, Kenya's high court upheld laws against same-sex relations, shocking activists campaigning to roll back anti-gay laws and stigma still widespread in Africa.
At present, 28 out of 49 countries in sub-Saharan Africa, including Botswana, have laws penalising same-sex relationships, according to Human Rights Watch.