The French parliament on Tuesday defied months of angry protests by approving a bill that is to make France the 14th country worldwide to legalise same-sex marriages.
But opponents to the law vowed to fight on, quickly filing a constitutional challenge and promising more demonstrations to pressure President Francois Hollande into backing down from signing the bill.
In its second and final reading, the lower house of parliament, the National Assembly, voted 331 to 225 to adopt the bill allowing homosexual marriages and adoptions by gay couples.
Justice Minister Christiane Taubira hailed the adoption of the bill as a "historic" moment.
"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 is a victory for equality, for democracy and for coexistence," said Nicolas Gougain, a spokesman for Inter-LGBT, France's leading gay rights group.
"This law takes no rights away from anyone, it only grants rights to others. This is liberation after years of fighting for equality."
Shortly after the vote, lawmakers from right-wing parties said they had already filed a legal challenge with the constitutional council.
Senators from the main opposition UMP and other right-wing parties said "the definition of marriage, a fundamental principle... cannot be modified by a simple law".
They also said provisions allowing adoption by gay couples violate "fundamental principles" of France, including "the principle of human dignity and equality".
Thousands of opponents to the law refused to give up, demonstrating near to the National Assembly Tuesday evening.
"Don't touch marriage, deal with unemployment instead", read a large banner, destined for Hollande.
"We are going to show them that this is not over. I solemnly ask the president to hold a referendum on the subject," said Frigide Barjot, the leader of the "Manif pour tous" (Demo for All) group which has spearheaded the movement against the bill in recent months.
A mass protest is also planned for May 26.
Also quick to express its disappointment in the new bill was the Catholic Bishops' Conference of France.
Bishop Bernard Podvin told AFP of his "deep sadness" at the law, "even if it was clearly unsurprising" that the legislation passed.
"Democracy has spoken," he said. "But such a controversial law will not produce social cohesion."
In the eastern city of Lyon police briefly detained 15 people after clashes broke out during an anti-gay marriage protest of about 150 demonstrators.
Police said those held "tried to block access to the A6 motorway to Paris with concrete blocks" and attempted to throw metal barriers at officers but were stopped by a large police force.
No one was hurt in the incidents.
The constitutional council will now 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 step back from signing it.
Former president Jacques Chirac shelved an unpopular employment law that had been passed by parliament in 2006, but Hollande is seen as unlikely to follow that precedent.
The government is also confident that the constitutional challenge will be dismissed.
"We have ensured that there is no legal weakness," Family Minister Dominique Bertinotti said. "The constitutional council is sovereign but the government is serene. We're confident."
Hundreds of thousands have taken to the streets in a series of protests against the bill, surprising many in a country that is predominantly Catholic but known for its secular traditions.
The opposition turned increasingly nasty as the final vote approached.
Some politicians received threats, a handful of demonstrations ended in violence and there was even a scuffle in parliament as the debate concluded in the small hours of Friday.
The tensions have also been linked to a spike in hate crimes against the gay community that have included attacks on bars and two serious assaults in Paris.
Hollande could scarcely have anticipated the scale of the opposition he would face over a reform that initially seemed to enjoy solid majority backing among French voters.
But recent polls have suggested a campaign in which the Roman Catholic Church initially played the leading role has shifted opinion to the extent that the electorate is now fairly evenly split on both gay marriage and adoption.
Hollande's partner, Valerie Trierweiler, has revealed that the president will be attending the marriages of gay friends once the legislation is on the statute books.
In a Tweet after the vote, Trierweiler hailed Tuesday as a "historic day", using the hashtag "#equalityforall".
In a sign that the new law has already brought change to French society, a first gay wedding fair is due to take place on Saturday in Paris.
France's INSEE statistics agency says about 200,000 people declared themselves as living in same-sex couples in a 2011 study.
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.