France's lower house National Assembly on Tuesday adopted a bill legalising same-sex marriages and adoptions for gay couples, defying months of opposition protests.
In its second and final reading, a majority of lawmakers approved the bill by a vote of 331 to 225.
"After 136 hours and 46 minutes of debate, Parliament has adopted the law opening marriage to same-sex couples," the Socialist speaker of the Assembly, Claude Bartolone, said after the vote.
Bartolone, who was sent gunpowder in a threatening letter earlier this week, became furious when minor scuffles broke out in the public gallery. Some opponents of the bill had to be forcefully ejected as the vote took place.
"Get these enemies of democracy out of the parliament," he shouted.
Justice Minister Christiane Taubira hailed the adoption of the bill as a "historic" moment in French history.
"It grants new rights, stands firmly against discrimination (and) testifies to our country's respect for the institution of marriage," she said in a statement shortly after the vote.
"This law... brightens the horizons of many of our citizens who were deprived of these rights," she said.
The bill must still be signed by President Francois Hollande and is to face a challenge in France's constitutional council.
Shortly after the vote, lawmakers from right-wing parties said they had already filed a legal challenge with the council.
It will have a month to make a ruling and opponents are hoping that in the meantime they can build up enough pressure to force Hollande, who has been steadfast in supporting the bill, to back down from signing it.
Tens of thousands have taken to the streets in recent months to oppose the bill, in demonstrations that have occasionally spilled over into violence.
Earlier France's Minister for Women's Rights Najat Vallaud-Belkacem told The Local that violence cannot be tolerated.
“The violence is unacceptable and I condemn it in the strongest terms,” said Vallaud-Belkacem.
“In recent weeks we have seen a radicalization of some opponents of the bill. However, I will not confuse the peaceful protesters with those more extreme opponents, who do not hesitate to resort to violence - whether it's aggression towards elected officials, death threats or homophobic insults,” the minister added.
Riot police surrounded the National Assembly on Tuesday evening as anti-gay marriage protesters were due to hold a march at 7pm.
Meanwhile across town in the city's gay district the Marais, supporters gathered to celebrate the passing of the bill.
One of those who was "happy" to see gay marriage voted into law was Wilfred de Bruijn, who was the subject of a vicious homophobic attack two weeks ago.
"A law does not change society but I am happy," de Bruijn told The Local.
If Hollande signs the law, France will join eight other European countries - the Netherlands, Belgium, Spain, Norway, Sweden, Portugal, Iceland and Denmark - in legalising same-sex marriages.
New Zealand on April 17 became the first Asia-Pacific country to legalise same-sex marriages after a parliamentary vote overwhelmingly backed the move.