The men were arrested in a hotel in north-eastern Bauchi State, which is governed by the Islamic Sharia law.

The Sharia punishment for sodomy is death by stoning.

The men, reportedly wearing women's clothes, are said to have gone to Bauchi town from neighbouring states to celebrate a "gay wedding".

Sharia judge Malam Tanimu ordered that the 18 be remanded in prison after they were arraigned before him on Wednesday.

Prosecuting police officer Tadius Boboi said the men's actions had contravened Sharia law, adopted in Bauchi and a dozen other states in Muslim northern Nigeria in 2000.

Amputations

More than a dozen Nigerian Muslims have been sentenced to death by stoning and for sexual offences ranging from adultery and homosexuality.

But none of these death sentences have actually been carried out as they were either thrown out on appeal or commuted to prison terms as a result of pressure from human rights groups.

Many others have been sentenced to flogging by horsewhip for drinking.

But there have been two amputations in north-western Zamfara State which pioneered the introduction of the Islamic legal system in the country.

Taboo

Nigeria, like many African countries, is a conservative society where homosexuality is considered a taboo.

The Nigerian parliament has been trying to pass a controversial law introduced by former President Olusegun Obasanjo banning gay rights organisations.

Gay activists and some human rights groups have condemned the proposed legislation and called for its rejection.

But homosexuality and same sex marriage are illegal in Nigeria and are considered very serious offences.

In April, a woman reportedly fled Nigeria after being accused of organising a polygamous lesbian wedding.

She later denied the reports.

Two years ago, a Sharia court sentenced a man to six months in prison and fined him $38 for living as a woman for seven years in Kano.