Gabon has made gay sex illegal, an official has confirmed, making it the 70th country in the world to criminalise consensual same-sex sexual relations.

The central African country banned "sexual relations between people of the same sex" in a new penal code earlier this year, according to copies of the law online.

The penalty for gay sex in Gabon is up to six months in prison and a fine of 5m CFA francs (£6,400).

A government official who declined to be named confirmed the ban, which happened in July but was not widely reported.

The minister of justice declined to comment.

The worst destinations for LGBT+ holidaymakers Show all 10 1 /10 The worst destinations for LGBT+ holidaymakers The worst destinations for LGBT+ holidaymakers North Macedonia 16 per cent Getty Images The worst destinations for LGBT+ holidaymakers Moldova 14 per cent Getty Images/iStockphoto The worst destinations for LGBT+ holidaymakers Lichtenstein 14 per cent Getty Images/iStockphoto The worst destinations for LGBT+ holidaymakers Belarus 13 per cent Getty Images/iStockphoto The worst destinations for LGBT+ holidaymakers San Marino 13 per cent Getty Images/iStockphoto The worst destinations for LGBT+ holidaymakers Monaco 11 per cent Getty Images The worst destinations for LGBT+ holidaymakers Russia 10 per cent Getty Images The worst destinations for LGBT+ holidaymakers Armenia 6 per cent Getty Images/iStockphoto The worst destinations for LGBT+ holidaymakers Turkey 5 per cent Getty Images The worst destinations for LGBT+ holidaymakers Azerbaijan 3 per cent Getty Images/iStockphoto

Davis Mac-Iyalla, an activist who monitors LGBT+ rights in West Africa, said he had spoken to two Gabonese men arrested under the new law who had to bribe police to be released.

"It has further sent the LGBT community underground and has created harassment," said Mac-Iyalla of the Ghana-based Interfaith Diversity Network of West Africa.

"The corrupt police now use that, arrest people and then people have to bribe their way out."

These reports could not be independently confirmed.

Hopes for more reforms were raised last year when India's Supreme Court decriminalised gay sex, overturning a colonial-era law and spurring campaigners to press for similar reforms in other former British colonies.

When Botswana decriminalised gay sex in June, the number of countries outlawing same-sex relations fell to 69, according to LGBT+ advocacy group ILGA World - the lowest figure since it started monitoring such laws in 2006.

But large populations of religious conservatives, including growing numbers of Evangelical Christians, are opposed to LGBT+ rights in African countries including Uganda, Kenya and Nigeria.

In May, a Kenyan court upheld a law criminalising gay sex dating back to British rule. Advocates are challenging that ruling.

"Globally...we're seeing polarising tensions," said Lucas Ramon Mendos, a researcher at ILGA World.

"Where things are getting better, there is a momentum for even more improvement, and where things are bad now we're seeing things are worsening."​

In Africa, 33 out of 54 countries criminalise consensual same-sex relations.

Six African countries have scrapped their bans since 2012, marking a positive trend overall, said Neela Ghoshal, a researcher with Human Rights Watch.

"It's unfortunate that a lot of African countries have claimed and owned those homophobic, colonial values, but others haven't," she said.

"In general, across the continent, things are moving more in the right direction than in the wrong direction," she said. "I'm guessing you'll see a lot of change in the next 10 years or so."