BOTSWANA's high court has rejected sections of the penal code that criminalise same-sex relations and impose up to seven years in prison.

The unanimous ruling in the southern African nation called the sections unconstitutional.

This comes less than a month after Kenya's high court upheld similar sections of its penal code in another closely watched case.

More than two dozen countries in sub-Saharan Africa have laws criminalising gay sex.

Those arguing against the laws say they leave people in the LGBT community vulnerable to discrimination and abuse, while making it difficult for them to access basic healthcare and other services.

The Botswana-based non-governmental group Legabibo said such laws "infringe on basic human dignity".

Earlier this year, the southern African nation of Angola decriminalised same-sex activity and banned discrimination based on sexual orientation.