Sharia police arrested 12 men accusing them of attempting gay marriage in Nigeria's second city of Kano, though 10 were later released, a spokesman for the board overseeing Islamic rules in the area said on Tuesday.
Gay marriage, same-sex relationships and membership of gay rights groups were banned in January 2014 by President Goodluck Jonathan despite Western pressures over gay rights and threats of aid cuts to those passing laws that persecute homosexuals.
Nigeria's population is roughly split between predominantly Christians in the south and Muslims in the north. As in much of sub-Saharan Africa, anti-gay sentiment extends across the religious divide.
A spokesman for the sharia law group, Mohammed Yusuf Yola, said the men were arrested at the scene of the ceremony on the outskirts of Kano on Sunday following a tip-off.
"It is still an allegation but when we screened them, they really looked gay, and the way they behaved was gay," Yola said.
Ten out of the 12 suspects were released after their parents signed a statement saying they would keep their children away from such activities, Yola said, but would be handed over to the police for prosecution if they were caught again. Nigeria's anti-gay laws provide for sentences of up to 14 years in prison.