Local and international groups fighting AIDS warned on Tuesday that a new Nigerian law criminalizing same-sex marriage and gay organizations will jeopardize the fight against the deadly disease.

Human rights activists reported that dozens of gay men were being arrested in northern Nigeria in an apparent response to the law. The United States, Britain and Canada condemned the law, with Secretary of State John Kerry saying Monday that it "dangerously restricts freedom" of expression and association of all Nigerians.

President Goodluck Jonathan’s spokesman confirmed Monday that he had signed the Same Sex Marriage Prohibition Act on Jan. 7, providing penalties of up to 14 years in jail for a gay marriage and up to 10 years’ imprisonment for membership or encouragement of gay club, societies and organizations.

The U.N. agency to fight 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."

The law also criminalizes people and groups who support "the registration, operation and sustenance of gay clubs, societies and organizations, processions or meetings in Nigeria." Those convicted could be jailed for 10 years.

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 HIV. The disease affects many more gay men than heterosexuals, with 2010 statistics estimating national HIV prevalence at 4 percent compared to 17 percent among gay men, according to UNAIDS.

Activist Dorothy Aken’Ova said the new legislation, already dubbed the "Jail the Gays" law, will endanger and even criminalize programs fighting HIV-AIDS in the gay community. Aken’Ova is executive director of Nigeria’s International Center for Reproductive Health and Sexual Rights based in Minna, Niger state.

Even before it was the passed, the law was being used to persecute gays, she said. In Bauchi state, she said police entrapped four gay men and tortured them into naming others. She said the police have drawn up a list of 168 wanted gay men, of whom 38 have been arrested recently.

Jonathan, Nigeria’s president, 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."