Four young men have beenconvicted of gay sex and whipped publicly as punishment in an Islamic court in northern Nigeria, according to a human rights activist.

The four were sentenced and punished on Thursday to 15 strokes. They also face a year's imprisonment if they cannot pay a fine of $120.

The men, aged between 20 and 22, should not have been convicted because their confessions were forced through beatings, said Dorothy Aken'Ova, the convenor of the Coalition for the Defence of Sexual Rights Network.

She said they had to prostrate themselves on the floor of the court to be whipped on their bottoms.

Aken'Ova said the families refused an offer of legal representation and were embarrassed by the stigma attached to homosexuality, which many highly religious Nigerians consider an evil imported from the West.

The hearings in Bauchi city, the capital of the state of the same name, had been delayed from January, when a crowd tried to stone the accused men outside the court and demanded the judge pass the death sentence.

Security officials had to fire into the air to save the men and disperse the crowd.

Under Islamic law in some north Nigerian states, homosexuals can be sentenced to death by stoning or lethal injection, though that sentence has never been enforced.

The judge said he was lenient because the men had promised that the homosexual acts occurred in the past and that they had since changed their ways, according to Aken'Ova.

The four were among dozens caught in a wave of arrests after Nigeria strengthened its criminal penalties for homosexuality with the new Same Sex Marriage Prohibition Act in January.