(CNN) -- Nigerian President Goodluck Jonathan has signed into law a ban on same-sex marriage in Africa's most populous nation.
U.S. Secretary of State John Kerry slammed the decision Monday.
"Beyond even prohibiting same-sex marriage, this law dangerously restricts freedom of assembly, association and expression for all Nigerians," he said in a statement.
"People everywhere deserve to live in freedom and equality. No one should face violence or discrimination for who they are or who they love."
Samantha Power, U.S. ambassador to the United Nations, characterized the law as a "big setback for human rights for all Nigerians."
According to the News Agency of Nigeria (NAN), the bill passed by the Senate at the end of last year introduces a 14-year prison sentence for people who are convicted of entering into a same-sex marriage or civil union.
It also reportedly makes it an offense to administer, witness or help at a same-sex marriage ceremony.
NAN said the law also forbids people from running gay clubs, societies, processions or meetings in Nigeria. The punishment for such acts is 10 years in prison, it said.
And the law even states that marriages or civil unions from outside the country will be void inside the country, according to NAN.
Last month, Uganda's parliament passed controversial legislation that would make some gay acts punishable by life in prison.
For the bill to become law, it would need the signature of that county's president, who has 30 days to make a decision.
Homosexuality is illegal in most African nations based on remnants of sodomy laws introduced during the British colonial era and perpetuated by cultural beliefs.
Punishments across the continent range from fines to years in prison.
Worldwide, a growing number of countries now allow same-sex marriage, the majority of them in Europe.
The Netherlands was the first, in 2001, and it was later joined by Belgium, Spain, Norway, Sweden, Iceland, Portugal, Denmark and France. A bill to allow same-sex marriage in England and Wales is also now law, though it isn't expected to come into force until later this year.
Argentina, Uruguay, Canada, Brazil, New Zealand and South Africa are the non-European countries in the group, according to the Pew Research Center.
Same-sex marriage is also legal in some parts of Mexico and the United States.
CNN's Christian Purefoy, Marilia Brocchetto and Faith Karimi contributed to this report.