In this instance, authorities responded to an unfounded rumor that the United States had paid gay activists $20 million to promote same-sex marriage in this highly religious and conservative nation, according to an AIDS counselor, who spoke on condition for fear that he would be arrested.
An officer pretending to be a gay man then joined a group being counseled on AIDS, according to Dorothy Aken'Ova, executive director of Nigeria's International Center for Reproductive Health and Sexual Rights.
Aken'Ova said police detained four gay men over the Christmas holidays and tortured them until they named others allegedly belonging to a gay organization. She gave no details of what she called torture, but the AIDS counselor said the four men were brutally beaten until they gave up names.
The police have now arrested 38 men and are looking for 168 others, according to Aken'Ova, whose organization is helping provide legal services to the men. The AIDS counselor said he has helped secure bail for some of the 38 detainees. They both said dozens of homosexuals have fled Bauchi in recent days.
Chairman Mustapha Baba Ilela of Bauchi state Shariah Commission, which oversees regulation of Islamic law, said that 11 gay men have been arrested over the past two weeks. He said community members helped "fish out" the suspects and that "we are on the hunt for others."
Bauchi state has both a Western-style penal code and Shariah, or Islamic law, which is implemented to different degrees in nine of Nigeria's 36 states. About half of the country's more than 175 million people are Muslims, the other half Christians.
Ilela said all 11 arrested 10 Muslims and a non-Muslim signed confessions that they belonged to a gay organization, but that some of them retracted the statements in court.
He denied any force was involved.
"They have never been tortured, they have never been beaten, they have never been intimidated," he said.
Nigerian law enforcers are notorious for torturing suspects to extract confessions. They also are known for extorting money from victims to allow them to get out of jail cells.
Olumide Makanjuola said lawyers for his Initiative For Equality in Nigeria are backing lawsuits of several homosexuals arrested by police without cause. He said police regularly and illegally inspect the cell phones of gay suspects, then send text messages to lure others.
Then the men or women are told they will be charged and their sexual preferences exposed unless they pay bribes. "Some pay 5,000, some 10,000 naira ($30 to $60). Even though they have done nothing wrong, people are scared, people are afraid that even worse things will happen," Makanjuola said in a recent AP interview.
The new law was passed by the Nigerian Parliament last year but not signed by the president, Goodluck Jonathan, until last week when he did so quietly and without fanfare. Jonathan's office confirmed Monday that the Nigerian leader had signed it.
The United States, Britain and Canada condemned the new law, with Secretary of State John Kerry saying Monday that it "dangerously restricts freedom" of expression and association of all Nigerians.
While harsh, Nigeria's law is not as draconian as a bill passed last month by legislators in Uganda that is awaiting President Yoweri Museveni's signature. It provides penalties including life imprisonment for "aggravated" homosexual sex. Initially, legislators had been demanding the death sentence for gays.
The Nigerian law provides penalties of up to 14 years in jail for a gay marriage and up to 10 years' imprisonment for membership or encouragement of gay clubs, societies and organizations. That could include even groups formed to combat AIDS among gays, activists said.
The U.N. agency fighting AIDS and the Global Fund to Fight AIDS, Tuberculosis and Malaria expressed "deep concern that access to HIV services for lesbian, gay, bisexual and transgender people will be severely affected" and that the law could harm Jonathan's own presidential initiative to fight AIDS, started a year ago.
It said Nigeria has the second-largest HIV epidemic globally with an estimated 3.4 million people living with the virus. The disease affects many more gay men per capita than heterosexuals.
Jonathan has not publicly expressed his views on homosexuality.
But his spokesman, Reuben Abati, told The Associated Press on Monday night, "This is a law that is in line with the people's cultural and religious inclination. So it is a law that is a reflection of the beliefs and orientation of Nigerian people. ... Nigerians are pleased with it."
Many have asked why such a law is needed in a country where sodomy already was outlawed, and could get you killed under Shariah. Ilela said sodomy carries the death sentence in Bauchi state, with a judge deciding whether it should be done by a public stoning or by lethal injection.
No gay person has been subjected to such punishment.
Associated Press writer Shehu Saulawa contributed to this report from Bauchi, Nigeria.