The bill, a campaign pledge by the Socialist president, has been for months hotly contested by many conservatives in France, where allowing gay marriage is one of the biggest social reforms since abolition of the death penalty in 1981.

Opponents have staged huge and often violent demonstrations against the bill and have called yet another protest on May 26. The leader of opposition to gay marriage, a political activist and humorist who goes under the name of Frigide Barjot, has said the protest would draw millions into the streets.

Montpellier mayor Helene Mandroux, who is due to celebrate France's first gay marriage in the southern city on May 29, said the law marked a major social advance.

"Love has won out over hate," she said, while voicing concerns the first gay wedding could attract violent protests.

Unlike former president Francois Mitterrand's abolition of the death penalty, which most French people opposed at the time, polls showed more than half the country backed gay marriage.

Nonetheless, with Hollande's popularity ratings at record lows a year into office, the law has proved costly for the president with critics saying it has distracted his attention from reviving the recession-hit economy.