Michael Lebruru, one of three investigating judges, said sections 164 and 165 of the penal code undermined a person's right to dignity, privacy and freedom, and were discriminatory.
The court in the capital Gaborone overturned the two sections, in force since 1964, which criminalized "carnal knowledge of any person against the order of nature" and "unnatural offences," respectively, Efe news reported.
"Public opinion in cases like this is relevant but not decisive," Leburu said, adding: "This is about fundamental rights more than the public's view."
The complainants had requested a revision of the constitutionality of the laws criminalizing sexual relations between people of the same sex.
Having same-sex relations in Botswana was punishable by up to seven years in prison.
The judge said a democratic country practices tolerance, diversity and mental openness, adding that social inclusion is paramount to ending poverty and reaching shared prosperity.
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)