Nigerian President Goodluck Jonathan has signed a law this month that bans same-sex marriage and criminalizes homosexual associations, societies and meetings, with penalties of up to 14 years in jail.

The Associated Press obtained a copy of the Same Sex Marriage Prohibition Act on Monday that was signed by the president and dated Jan. 7.

It was unclear why the law's passage has been shrouded in secrecy. The copy obtained from the House of Representatives in Abuja, the Nigerian capital, showed it was signed by lawmakers and senators on Dec. 17, though no announcement was made.

Secretary of State John Kerry said Monday the United States was "deeply concerned" by a law that "dangerously restricts freedom of assembly, association, and expression for all Nigerians."

It is now a crime for two gay people to meet, to operate or go to a gay club, or other gay organization.

The new law says, "A person who registers, operates or participates in gay clubs, societies or organizations, or directly or indirectly makes public show of same-sex amorous relationship in Nigeria commits an offense and is liable on conviction to a term of 10 years."

Anyone convicted of entering into a same-sex marriage contract or civil union faces up to 14 years of imprisonment.

Nigeria already has a law inherited from British colonizers that makes homosexual sex illegal in the West African nation. In the areas in Nigeria's north, where Islamic Shariah law is enforced, gays and lesbians can face death by stoning.

Olumide Makanjuola, executive director of the Initiative For Equality in Nigeria, said those who will suffer most under the law are poor gay Nigerians. Many rich ones already have left the country, or say they will fly elsewhere to have sex, she said.

The court of the European Union recently ruled that anti-gay laws, like the one passed in Nigeria, could provide grounds for political asylum.

A spokesman for the British High Commission in Nigeria said, "The U.K. opposes any form of discrimination on the grounds of sexual orientation." The spokesman, traditionally not identified by name, echoed Kerry's concerns about freedom of expression, saying the law "infringes upon fundamental rights of expression and association which are guaranteed by the Nigerian Constitution and by international agreements to which Nigeria is a party."

The British government recently threatened to cut aid to African countries that violate the rights of gay and lesbian citizens. However, British aid remains quite small in oil-rich Nigeria, one of the top crude suppliers to the U.S.

Nigerians are the least tolerant nation when it comes to gays, with 98 percent surveyed saying society should not accept homosexuality, according to a study of 39 nations by the Pew Research Center.

Nigeria's law does not contain a previous proposal making it obligatory for anyone knowing a homosexual to report that person to authorities, or face up to seven years in jail. That would have included a parent or friend of a homosexual.

And it is not as draconian as a Ugandan bill approved by parliament in December and awaiting the signature of President Yoweri Museveni. That law provides punishment of up to life in prison for "aggravated" homosexual sex involving someone infected with HIV, a minor or disabled person.

The president of Gambia has said homosexuals should be decapitated.

Some 38 African countries -- about 70 percent of the continent -- criminalize homosexual activity, Amnesty International said in a report released last year.

When LGBT Nigerians tried to give evidence last year in debate in the House of Assembly, they were heckled and booed until one broke into tears, and another could not be heard.

A statement by the Nigerian Lesbian, Gay, Bisexual, Transexual and Intersex Diaspora to legislators urged them not to make them refugees.

Criminalizing same-sex relationships "turns us into asylum seekers in other countries," it said. "We visit home with trepidation because at home we have to live a life full of lies and deny who we are for us to be accepted. Why do we want to keep subjecting our citizens to such psychological and emotional torture?"

Al Jazeera and The Associated Press