More than 40 gay people arrested in Nigeria for allegedly performing homosexual acts were instead trying to inform communities on how to prevent HIV transmission, a leading LGBT activist has claimed.

At least 42 people were arrested in the Owode Onirin area of Lagos, Nigeria's commercial hub, on Saturday (29 July).

"There have been reports that the hotel harbours homosexuals," a witness, identified only as Tunji, told the Punch newspaper.

"They were there this afternoon when policemen struck. About 40 of them were caught in the act."

The newspaper also said Lagos State Police public relations officer, Olarinde Famous-Cole, confirmed the arrest.

"It is true. About 42 suspected homosexuals were arrested and the hotel has been cordoned off while investigation continues. They are in custody of the Lagos State Task Force and will be charged to court soon," he was quoted as saying.

According to the Cable, Cole also said it was not the first time that the hotel had "harboured homosexuals".

The claims were dismissed by LGBT activist Bisi Alimi, who became the first gay Nigerian to disclose his homosexuality on national TV in 2004.

"The reports are not true. There was a group of gay men who were organising a sexual health awareness party around HIV. They were trying to raise awareness about HIV testing," he told IBTimes UK.

Alimi explained such activities are not uncommon in Nigeria, where he used to hold at least three or four similar informative events every year.

"Police hijacked the party because people within the area complained," said Alimi – who heads the London-based Bisi Alimi Foundation, which aims to promote social acceptance of LGBT people in Nigeria.

"They reported that a group of gay men were having a party there. What is not clear is what these homosexual acts were. I am practically disgusted that the Nigerian police arrested a group of young men who were trying to save themselves from the HIV epidemic and considered them as criminal," he concluded.

The Lagos police did not respond to a request for a comment on Bisis' claims.

Anti gay-laws in Nigeria

LGBT crime
Homosexuality is considered a crime in Nigeria, with gay people at risk of being imprisoned for up to 14 years Getty

Homosexuality is illegal in Nigeria.

Nigerians involved in a gay marriage or civil union face imprisonment for up to 14 years under the Same Sex Marriage (Prohibition) Bill signed into law by former Nigerian president Goodluck Jonathan in 2014.

According to the bill, dubbed "Jail the Gays", anyone who registers, operates or takes part in gay organisations or makes a public show of a same-sex relationship will also be punished with up to 10 years in prison.

The implementation of the law prompted a crackdown on homosexuals. Amnesty International said the new legislation disregards human rights and warned it mirrored the laws enforced by the military dictators who ruled Nigeria until 1999.

President Muhammadu Buhari, who defeated Jonathan in 2015's election, has not hinted he would amend or scrap anti-gay laws in the country. The US, which under former US President Obama had become a staunch ally of Nigeria after Buhari took office, said it would put pressure on Nigeria to scrap homophobic laws and allow homosexual unions.

Nigeria up close: Check out our Flipboard magazine