Prosecutors in the northern Nigeria state of Kaduna have charged a group of 53 people with conspiring to celebrate a gay wedding.
The accused, arrested last Saturday, have denied the allegations, with their lawyers saying they were illegally detained.
The court released the group on bail and the case was remanded to 8 May.
Homosexual acts are banned in socially conservative Nigeria and are punishable by up to 14 years in jail.
During a court appearance in Chediya-Zaria, the group pleaded not guilty to charges of conspiracy, unlawful assembly and belonging to an unlawful society.
Defence lawyer Yunusa Umar said most of the accused were students and had been illegally detained for more than 24 hours, the local Premium Times newspaper reported.
Gay rights campaigners who have been in touch with people involved in the case told the BBC's Stephanie Hegarty in Lagos the accused were arrested at a birthday party, not a wedding.
Nigeria has an influential Christian evangelical movement in the south and strong support for Islamic law in the north, both of which oppose homosexuality.
In January 2014, the Hisbah, or Islamic police, in Bauchi state raided several locations and arrested about a dozen men accused of sodomy acts.
Some of the men later appeared before a Sharia court for a bail hearing and an angry crowd gathered outside, demanding swift and severe punishment.
Stones were thrown at the court and the hearing was halted.
Police had to shoot in the air to disperse the mob and get the suspects back to prison safely, though there they are also vulnerable.
The ban on homosexuality, brought into effect in 2014, is used by some police officers and members of the public to legitimise abuses against lesbian, gay, bisexual and transgender (LGBT) people, according to Human Rights Watch (HRW).
"Extortion, mob violence, arbitrary arrest, torture in detention, and physical and sexual violence" are common against people suspected of homosexual activities, HRW said in a 2016 report.
Latest Stories
-
We didn’t sneak out 10 BVDs; they were auctioned as obsolete equipment – EC
2 hours -
King Charles to resume public duties after progress in cancer treatment
3 hours -
Arda Guler scores on first start in La Liga as Madrid beat Real Sociedad
3 hours -
Fatawu Issahaku’s Leicester City secures Premier League promotion after Leeds defeat
3 hours -
Anticipation builds as Junior Speller hosts nationwide auditions
4 hours -
Etse Sikanku: The driver’s mate conundrum
4 hours -
IMF Deputy Chief worried large chunk of Eurobonds is used to service debt
5 hours -
Otumfuo Osei Tutu II celebrates 25 years of peaceful rule on golden stool
5 hours -
We have enough funds to pay accruing benefits; we’ve never missed pension payments since 1991 – SSNIT
5 hours -
Let’s embrace shared vision and propel National Banking College – First Deputy Governor
6 hours -
Liverpool agree compensation deal with Feyenoord for Slot
6 hours -
Ejisu by-election: There’s no evidence of NPP engaging in vote-buying – Ahiagbah
6 hours -
Ejisu by-election: Independent ex-NPP MP’s campaign team warns party against dubious tactics
6 hours -
ZEN Petroleum supports Tse-Addo Future Leaders School
7 hours -
NPP must win back Adentan seat in 2024 polls – Obeng Fosu
7 hours