LAGOS, Nigeria — First the police targeted the gay men, then tortured them into naming dozens of others who now are being hunted down, human rights activists said Tuesday, warning that such persecution will rise under a new Nigerian law.

The men’s alleged crime? Belonging to a gay organization. The punishment? Up to 10 years in jail under the Same Sex Marriage Prohibition Act that is getting international condemnation.

Dubbed the “Jail the Gays” bill, it further criminalizes homosexuality and will endanger programs fighting HIV-AIDS in the gay community, Dorothy Aken’Ova, executive director of Nigeria’s International Center for Reproductive Health and Sexual Rights, told The Associated Press on Tuesday.

On Monday, President Goodluck Jonathan’s office confirmed that the Nigerian leader signed the Same Sex Marriage Prohibition Act that criminalizes gay marriage, gay organizations and anyone working with or promoting them.

The witch hunt in Bauchi state all began with a wild 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.

He said he helped get bail for some 38 men arrested since Christmas. The man spoke on condition of anonymity for fear he too would be arrested.

He and Aken’Ova said dozens of homosexuals have fled Bauchi in recent days.

Aken’Ova, whose organization is helping with legal services for the arrested men, said a law enforcement officer pretending to be a gay man joined a group being counseled on AIDS. Police detained four gay men and then tortured them until they named others allegedly belonging to a gay organization, she said, adding that police now have a list of 168 wanted gay men.

She said the arrests began during the Christmas holidays and blamed “all the noise that was going on surrounding the (same sex marriage prohibition) bill.”

Chairman Mustapha Baba Ilela of Bauchi state Shariah Commission, which oversees regulation of Islamic law, told the AP that 11 gay men have been arrested in the past two weeks. He said community members helped “fish out” the suspects.

“We are on the hunt for others,” he said, refusing to specify how many.

Bauchi state has both Shariah law and a Western-style penal code. Shariah is Islamic law, which is implemented to different degrees in nine of Nigeria’s 36 states.

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 there was any force involved: “They have never been tortured, they have never been beaten, they have never been intimidated.”

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 go through the cell phone of a gay suspect, then send text messages to lure in others.

Then the men or women are told they will be charged and their sexuality 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 United States, Britain and Canada condemned the new law in Africa’s most populous nation, 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 Nigeria 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 by a new law in Nigeria — further criminalizing LGBT people, organizations and activities, as well as people who support them.”

UNAIDS said 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.