An angry mob attacked seven men suspected of breaking Islamic law banning homosexuality after a court hearing in northern Nigeria, a court official said on Thursday.
"As soon as the suspects emerged from the courtroom to get into the waiting prison van, a crowd of people in their hundreds began hurling stones and insults," Abdul Mohammed told AFP.
Mohammed, a clerk at the state Sharia court in Bauchi, said the seven men were among 12 being held on suspicion of breaking Islamic law concerning homosexuality.
"The suspects were hurriedly ushered into the van and rushed out of the area under security escort while the police used teargas and fired shots into the air to disperse the angry crowd," he added.
Police succeeded in dispersing the mob after 20 minutes, he said, adding that the crowd was angry at the pace of proceedings and were calling for a speedy trial and conviction.
To do so was "not justifiable in such a legal case that provides for death penalty", he said.
Nigeria this month banned gay marriage and same-sex unions, threatening stringent penalties also on anyone found supporting gay groups or clubs.
The seven suspects were detained in the wake of the promulgation but are being tried under Islamic law, which runs parallel to state and federal justice systems in northern states.
The offence in the north carries the death penalty, although it is rarely, if ever, carried out.
Last week, the same court ordered a man convicted of breaking Islamic law on homosexuality to be whipped 20 times in public and fined 5,000 naira ($30).
The seven men at the latest hearing on Wednesday included a school principal, who was one of five who appeared in court earlier this month accused of belonging to a gay club.
Four of the men pleaded guilty while the headteacher denied the charge.
The judge said that despite their guilty plea, it would be a "travesty of justice" to convict the four for an offence committed four years ago "and to which they had repented", Mohammed added.
The Sharia Commission, which files charges, was ordered to review the cases and if no fresh accusations came to light, they should be released.
Their cases were adjourned until January 27.
Meanwhile, Mohammed said the court threw out the testimony of a prosecution witness against two other defendants accused of being gay lovers, because they had not been caught "in the act".