France will see its first gay weddings within days, after French President Francois Hollande signed a law Saturday authorizing marriage and adoption by same-sex couples and ending months of nationwide protests and wrenching debate.

Hollande’s office said he signed the bill Saturday morning, a day after the Constitutional Council struck down a challenge to the law and ruled that it is in line with France’s constitution.

Hollande, a Socialist, had made legalizing gay marriage a campaign pledge last year. While polls for years have shown majority support for gay marriage in France, adoption by same-sex couples is more controversial.

The parliamentary debate exposed a deep attachment to the traditional family structure in France’s rural core, which is often eclipsed by and at odds with libertine Paris. But mostly, it tapped into profound discontent with the Socialist government, largely over Hollande’s handling of the economy. Months of anti-gay-marriage protests became a flash point for frustrations with Hollande and occasionally degenerated into violence.

In addition, gay rights groups reported a rise in attacks on gay men and lesbians as the parliamentary debate was under way. Protest organizers distanced themselves from the troublemakers.

The opposition isn’t ready to give up. It plans a protest for May 26 that aims to parlay the efforts of the anti-gay-marriage movement into a broader anti-Hollande one. Among those expected to attend is Jean-Francois Cope, the leader of the opposition UMP party, riven by divisions and struggling for direction since Nicolas Sarkozy lost the presidency last year.

Hollande warned that he would not accept any disruption of France’s first same-sex marriages.

According to French law, couples must register to marry in city hall and wait at least 10 days before holding a ceremony so that anyone objecting to the union, such as an existing spouse, has time to intervene.

Despite the protests, the law passed easily in both houses of Parliament, which are dominated by Hollande’s Socialists.

France is the most populous country to have legalized same-sex marriage and the 14th country worldwide.

— Associated Press

A picture taken on December 16, 2012 in Paris shows a man kissing his companion during a demonstration for the legalisation of gay marriage and LGBT (lesbian, gay, bisexual, and transgender) parenting. (LIONEL BONAVENTURE/AFP/GETTY IMAGES)