The president of Gambia has signed a bill into law that calls for life imprisonment for some homosexual acts, the latest African country to codify harsh penalties for gay people.

A copy of the legislation, obtained by the Associated Press on Friday, indicates that President Yahya Jammeh signed it on 9 October, though no government officials have publicly notified the country of the law. Jammeh, one of Africa’s most outspoken anti-gay leaders, instructed gay and lesbian people in 2008 to leave the country or risk decapitation.

Politicians approved the legislation in August, prompting an outcry from human rights organisations including Amnesty International and Human Rights Watch. The law contains language identical to an anti-gay bill signed into law in Uganda earlier this year but later overturned by a court on procedural grounds.

The Gambian law criminalises “aggravated homosexuality”, and targets “serial offenders” and people living with HIV or Aids. Suspects can be charged with aggravated homosexuality for engaging in homosexual acts with someone who is under 18, disabled or who has been drugged. The term also applies when the suspect is the parent or guardian of the other person, or is “in authority over” him or her.

People found guilty of aggravated homosexuality can be sentenced to life in prison.

Amnesty International recently reported that Gambian security forces were allegedly torturing people arrested in raids, threatening them with rape and pressuring them to confess to homosexual acts.

The arrests were the first under the law, Amnesty said on Thursday. At least four men, a 17-year-old boy and nine women had reportedly been arrested in recent weeks on suspicion of committing homosexual acts, the group added.

An earlier statement described how the suspects were detained at the headquarters of the National Intelligence Agency in Banjul. “They were subjected to torture and ill-treatment to force them to confess their so-called ‘crimes’ and to reveal information about other individuals perceived to be gay or lesbian.”

Amnesty accused the security forces of resorting to beatings and the threat of rape and other abuses if they did not confess.