(CNN) -- The Nigerian senate has passed a bill banning same-sex marriages, defying a threat from Britain to withhold aid from nations violating gay rights.
The bill by Africa's most populous nation calls for a 14-year sentence for anyone convicted of homosexuality. Anyone who aids or "abets" same-sex unions faces 10 years in prison, a provision that could target rights groups.
It goes to the nation's House of Representatives for a vote before President Goodluck Jonathan can sign it into law.
"It would place a wide range of people at risk of criminal sanctions, including human rights defenders and anyone else -- including friends, families and colleagues -- who stands up for the rights of lesbian, gay, bisexual or transgender people in Nigeria," Amnesty International said in a statement.
The bill passed Tuesday comes nearly a month after British prime minister, David Cameron, threatened to withhold aid from nations violating gays rights, sparking outrage in Africa where leaders interpreted it as "colonial" display of power.
Homosexuality is illegal in most African countries 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.
"This is something we raise continually and ... we're also saying that British aid should have more strings attached in terms of 'do you persecute people for their faith or their Christianity or do you persecute people for their sexuality?" Cameron said in a statement.
"We don't think that's acceptable. So look, this is an issue where we want movement, we're pushing for movement, we're prepared to put some money behind what we believe."
Soon after his remarks earlier this month, a flurry of African governments released defiant statements accusing him of undermining their sovereignty and culture.
Last week, Zimbabwean President Robert Mugabe, known for his anti-gay rhetoric, called the prime minister "satanic" for demanding gay rights.
"Do not get tempted into that (homosexuality) madness. You are young people. If you go that direction, we will punish you severely," state media quoted him as saying. "It is condemned by nature. It is condemned by insects and that is why I have said they are worse than pigs and dogs."
Mugabe's comments were the latest in a series of strident remarks by African leaders.
Ugandan government spokesman Fred Opolot described Cameron's remarks as "patronizing, colonial rhetoric," saying the nation is busy expanding its oil sector to reduce its reliance on aid.
"We are working hard to limit our reliance on foreign governments for this reason," he said. "Statements like the one Cameron is making are false. Our cultural norms and values don't accept homosexuality, but there is no policy against gay people."
In 2009, a Ugandan lawmaker introduced a proposal calling for execution of people convicted of homosexuality. The proposal sparked an international outcry and threats from some European countries to cut aid to the nation, which relies on millions of dollars from foreign nations.
Opolot said the proposal was the opinion of a sole lawmaker and did not reflect the government view. The legislation was eventually shelved, but regularly pops up in parliament and remains a simmering issue.
Ghanaian President John Atta Mills, a major western ally, applauded the benefits of foreign aid, but said the nation will not accept money that will undermine its interest.
"I will never initiate or support any attempt to legalize homosexuality in Ghana," he told journalists this month, according to state media. "As government we will abide by the principles as contained in our Constitution, which is supreme."
Tanzanian officials decried the remarks, saying they "can lead to broken relations" between the two nations.
Cameron's statements also sparked a fiery debate among Africans on social media, where opinions were divided.
"At first, I was upset. I thought, how dare he treats us like this?' said Nigel Mugamu, 33, who lives in Harare, Zimbabwe.
"Then I thought about it," the businessman said. "The U.K. economy is struggling. They spend a lot of money on aid. Given what's happening economically. Maybe it's a nice way of saying -- we can't afford it?"
Mugamu said the threat should be an opportunity to open up a dialogue on an issue considered a taboo in African culture.
"Now is the time to talk about it ... to get our house in order. Lets use this opportunity to say, 'OK, if we didn't have aid, how would we survive?" he said. "Let's talk about gay rights issues. Let's turn this into a national -- African discussion."
Others said while denying aid would be extreme, the continent has a long way to go when it comes to human rights.
"It would be ridiculous if that mentality -- pride from leaders on both sides -- got in the way of millions benefiting from aid," said Aida Mbowa, a Stanford University doctorate student who lives in the Kenyan capital of Nairobi.
However, she said, the threat thrusts the issue to the forefront.
"We need minority rights in the continent. There's a part of me that knows this threat will not have much of an impact. But in a way, it's an achievement, however small. Despite the differences in opinion ... it has brought the conversation out in the open."
The Gay and Lesbian Coalition of Kenya said while Cameron's remarks are a positive gesture, they risk turning homosexuals into targets. It urged the prime minister to instead consider directing some aid to community programs aimed at fostering dialogue and tolerance.
"Support national and regional human rights mechanisms to ensure the inclusiveness of lesbian, gay, bisexual, and transgender issues in their protective and promotional mandates," the group said.
As the prejudices rage on, gays and lesbians in the continent lead fidgety lives, including forming underground movements that change locations regularly for safety issues.
Sexual violence against lesbians has become so common in South Africa, the nation has coined a new term "corrective rape" to describe it. South Africa -- one of the more progressive nations in the continent on the issue -- was the first African country to impose a constitutional ban on discrimination based on sexual orientation.
Cameron said he does not expect a sudden change in mindsets, and admits it will take time.
Journalist Columbus S. Mavhunga contributed to this report from Harare, Zimbabwe