What you need to know:
- British Prime Minister David Cameron has warned that his country will consider withholding aid from countries that do not recognise gay rights. The United States has expressed concerns over the Nigerian legislation.
Nigerian lawmakers approved Thursday a bill to outlaw gay marriage and crack down on gay rights, including criminalising public displays of affection between same-sex couples.
The House of Representatives unanimously approved the bill which provides for jail terms of up to 14 years for gay marriage.
A bill on gays has already been approved by the Senate but it was not immediately clear if the laws were identical.
If there are no differences between the two, the bill will now go to the president for his approval.
Under the bill, "persons that entered into a same-gender marriage or civil union contract commit an offence and are jointly liable on conviction to a term of 14 years imprisonment each."
It also says "any person who registers, operates or participates in gay clubs, societies and organisations or directly or indirectly makes a public show of a same-sex amorous relationship commits an offence and shall be liable to a term of 10 years imprisonment."
"I no longer feel safe under this law," said Rashidi Williams, director of Nigeria's Queer Alliance rights group.
"It has the potential to encourage instigation of violence against gay people and lesbians," he told AFP.
"Being gay... is a right and that right must be respected and protected by lawmakers and the state."
It is unclear why lawmakers have made such a ban a priority other than to gain popular support since gay marriage is not known to be prevalent in Nigeria and homosexuals are already harshly discriminated against.
Human Rights lawyer Jiti Ogunye told AFP that in passing the bill lawmakers had engaged in an "unneccessary publicity stunt."
"I call it legislative showmanship... This is really, really not a pressing national issue," he said.
He argued that Nigerian politicians were likely seeking to defy mounting Western pressure over gay rights, describing the bill as "a waste of time."
British Prime Minister David Cameron has warned that his country will consider withholding aid from countries that do not recognise gay rights. The United States has expressed concerns over the Nigerian legislation.
Last year, US President Barack Obama ordered all government agencies that play an active foreign policy role to take steps to encourage foreign nations to put a premium on gay, lesbian, bisexual and transgender rights.
Ogunye doubted that lawmakers acted under pressure from religious groups who support tighter anti-gay measures, saying politicians acted on their own initiative.
Nigeria is a highly religious society, with its 160 million people roughly divided in half between Christians and Muslims, though a significant number are also believed to follow traditional religions.
Homosexual acts have been illegal in Nigeria since independence in 1960, with the new nation continuing a prohibition put in place during British colonial rule.
The crime of "unnatural offence" -- which also covers sexual contact with animals and certain heterosexual acts -- has rarely been prosecuted.