Same-sex sexual acts became legal on 11 June 2019. Previously,
sodomy, whether heterosexual or homosexual, was criminalised, punishable by up to seven years' imprisonment. The law criminalising such sexual activity applied to both men and women. Initially, its application was limited to men only (similar to other colonies of the
British Empire), however, a Botswana court found this to be discriminatory and that the law should apply to women as well. Although same-sex sexual acts remained illegal until June 2019, their prosecution was rare. On March 30th 2016, the
Gaborone City Council unanimously approved a motion calling for the repeal of Botswana's criminalisation of same-sex sexual acts. Letsweletse Motshidiemang, a student at the
University of Botswana, was the lead plaintiff in a case to legalise homosexuality in Botswana. In November 2017,
LEGABIBO successfully applied to join the case as a
friend of the court. The lawsuit sought to declare Section 164(a) and 167 of the Penal Code unconstitutional because "they interfere with his [the student's] fundamental right to liberty, freedom of privacy, as well as his right to use his body as he sees fit." However, the Deputy Attorney General argued that these sections were constitutional because they prohibited certain sexual acts which may be conducted by those of all sexual orientations, whether heterosexual or homosexual, and thus that these laws do not discriminate based on sexual orientation. Initially, the High Court was supposed to hear the case in March 2018. In February, however, the Deputy Attorney General asked for more time to respond to the plaintiffs' claims. As such, the High Court moved the hearing to 31 May 2018. The case was then postponed again. On 6 December 2018, the Court rescheduled the hearing for 14 March 2019. LGBTQ activists presented their arguments at the hearing and were given a date of 11 June for the judgement. Judge Michael Leburu further said that such laws "deserve a place in the museum or archives and not in the world". In July 2019, the
Government of Botswana appealed the High Court ruling to the
Court of Appeal. Attorney-General Abraham Keetshabe argued that the court was mistaken in its conclusion in overturning the sodomy law, saying, "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", without giving further details of the grounds for the appeal. LEGABIBO and LGBTQ activists slammed the appeal calling it disappointing and an affirmation of persistent homophobia and transphobia. The appeal was unanimously rejected on 29 November 2021, with retiring Court of Appeal president
Ian Kirby writing for the court that laws criminalizing same-sex relations "have outlived their usefulness, and serve only to incentivise law enforcement agents to become key-hole peepers and intruders into the private space of citizens". In March 2026, the invalidated provisions were formally removed from the statute book through subsidiary legislation issued under the Revision of the Laws Act. A
statutory instrument titled
"Rectification of the Laws (Penal Code) Order, 2026", made by the Law Revision Commissioner, deleted paragraphs (a) and (c) of section 164 of the Penal Code. This was after years of legislative inaction after the courts had already declared the provisions unconstitutional, first by the High Court in 2019 and definitively by the Court of Appeal in 2021. Although the provisions had ceased to have legal effect upon being struck down, their deletion constituted a process of statute law revision, aligning the written law with the constitutional position established by the judiciary. ==Recognition of same-sex relationships==