An Islamic court in northern Nigeria on Tuesday cleared two men accused of violating a ban on homosexuality, according to a court official.
The pair, who had denied the charge, were acquitted because of a lack of evidence, Abdul Mohammed, a clerk at the court in the city of Bauchi told AFP.
The two were among 12 men accused in January of belonging to a gay club and having received funding from the United States for an apparent membership drive.
Five of the 12 still have cases pending against them while four others were convicted, fined and given 15 lashes each with a horsewhip as a "correctional punishment".
A Christian suspect's case is being heard in a secular court.
"The judge discharged and acquitted the two men for the prosecution's failure to prove their guilt," said Mohammed, from the Upper Sharia Court in the Unguwar Jaki area of Bauchi.
In his ruling, judge El-Yakub Aliyu said that the case needed to be proven beyond reasonable doubt.
"He (the judge) said sodomy is punishable with death and requires the testimony of four witnesses to the act and in the case of the two men, no one saw them committing sodomy," Mohammed added.
The lone prosecution witness in the trial said he did not witness the defendants breaking the law.
According to the prosecution, the two men were suspected to have been lovers.
They were arrested after local residents broke into a house in Bauchi and found one of them wearing shorts. The other was fully clothed.
The judge said the prosecution could appeal the judgement within 30 days but it was not clear whether the Bauchi state Sharia Commission, which brought the charges, would challenge the ruling.
"We will meet and review the Judgment and then decide what line of action to take," said commission official Jibril Danlami Alassan.
"The Sharia Commission has done its job by arresting and arraigning people it found violating the law against homosexuality and it rests with the court to prosecute them by establishing their guilt or innocence."
The two defendants had earlier been released on bail.
Their trial and those of the other five had been held in secret on security grounds since a mob attacked the court on January 23, demanding the defendants' immediate execution.
Police had to break up the riot with tear gas.
Homosexuality is illegal under Islamic law, which is in force across mainly Muslim northern Nigeria alongside state and federal justice systems.
The 12 men's cases came to light just as it emerged that Nigeria's President Goodluck Jonathan had passed into law new legislation banning gay marriage and same-sex unions.
The legislation has majority support in religiously conservative Nigeria but Western powers including the United States have called the law discriminatory.