Ghana's parliament voted to pass a controversial bill to severely restrict LGBTQ rights on Wednesday in a move condemned by activists.
The bill still has to be validated by the president before becoming law, which observers believe is unlikely before a general election in December.
Activist groups have called the "Human Sexual Rights and Family Values" bill a setback for human rights and urged President Nana Akufo-Addo's government to reject it.
But the bill is widely supported in Ghana, where Akufo-Addo has said gay marriage will never be allowed while he is in power.
Commonly referred to as the anti-gay bill, the sweeping legislation received sponsorship from a coalition comprising Christian, Muslim and Ghanaian traditional leaders, and passed through an unopposed voice vote.
Gay sex is already illegal in the religious West African nation, but while discrimination against LGBTQ people is common no one has ever been prosecuted under the colonial-era law.
Under the provisions of the bill, same-sex relations could be punished with imprisonment ranging from six months to three years.
Those advocating for LGBTQ rights could be subject to harsher penalties, with potential jail terms of three to five years.
'Absolutely wrong'
UN rights chief Volker Turk condemned the passing of the bill.
"I call for the bill not to become law," he said. "Consensual same-sex conduct should never be criminalised."
He warned that such measures can expose people to hate crimes, and urged the government to "ensure everyone can live free from violence, stigma and discrimination, regardless of their sexual orientation or gender identity."
In Washington, the US State Department said it was "deeply troubled" by the legislation is it would "threaten all Ghanaians' constitutionally protected freedoms of speech, press, and assembly."
"Limiting the rights of one group in a society undermines the rights of all," agency spokesman Matt Miller said in a statement.
A human rights coalition known as the Big 18, an umbrella group of lawyers and activists in Ghana, has also criticised the bill.
"You cannot criminalise a person's identity and that's what the bill is doing and it's absolutely wrong," said Takyiwaa Manuh, a member of the coalition.
"We want to impress on the president not to assent to the bill, it totally violates the human rights of the LGBT community," Manuh told AFP.
Opposition lawmaker Sam George, the main sponsor of the bill, called on Akufo-Addo to assent to it.
"There is nothing that deals with LGBTQ better than this bill that has been passed by parliament. We expect the president to walk his talk and be a man of his words," George said.
Members of Ghana's LGBTQ community are worried about the implications of the bill.
Founder and director of the organisation LGBT+ Rights Ghana Alex Donkor said "the passing of this bill will further marginalise and endanger LGBTQ individuals in Ghana."
"It not only legalises discrimination but also fosters an environment of fear and persecution," he said.
"With harsh penalties for both LGBTQ individuals and activists, this bill threatens the safety and well-being of an already vulnerable community."
Around 30 African countries currently ban homosexuality, according to the International Lesbian, Gay, Bisexual, Trans and Intersex Association (ILGA).
Uganda, Mauritania and several northern Nigerian states punish same-sex relations extremely harshly, with those accused possibly facing the death penalty.
South Africa is the only nation on the continent to allow gay marriage, which it legalised in 2006.
Same-sex relations have been decriminalised in only a handful of countries: Cape Verde, Gabon, Guinea-Bissau, Lesotho, Mozambique, and the Seychelles, according to the ILGA.
IOL