Two men have married each other in the southern French city of Montpellier in the first same-sex wedding in a country that has been rocked by protests against, and for, the reform.

Security was on high alert for the union of Vincent Autin and Bruno Boileau, who exchanged vows in the city hall on Wednesday before the mayor, relatives and friends, as dozens of riot police stood guard outside to ensure the ceremony was not interrupted by protestors.

The two men, who have been together since they hit it off six years ago discussing music in an online forum, embraced to wild cheers from the audience of about 500 people and the strains of "Love and Marriage" by Frank Sinatra.

"It's a great pleasure for me to declare you married by law," said Montpellier Mayor Helene Mandroux as the couple, both dressed in dark suits, kissed and signed the marriage registry.

The ceremony marked a symbolic end to months of debate that often overshadowed France's economic woes, contributing Socialist President Francois Hollande's reputation as a reformer despite bitter and continued opposition from Catholics and conservatives.

"This is a historic moment in your own lives ... and a historic moment for our country," Mandroux told the ceremony. "We are building here together the society of tomorrow."

'Society of tomorrow'

Despite support for the reform in Montpellier, which boasts of being France's most gay-friendly town, officials scrapped plans to broadcast the wedding live on a giant TV screen and instead beamed it live online to the city's website.

Moments before the men walked in, a smoke bomb was lobbed from outside into the perimeter of the city hall. Security guards rushed to investigate, but the wedding went ahead. 

An emotional Autin gave a brief speech to the audience, thanking his family, friends and government spokeswoman Najat Vallaud-Belkacem, a personal friend present at the ceremony.

"Love each other, love us, love one another, because it's important," said Autin from a balcony to a crowd of hundreds of well-wishers outside the city hall, adding the next step would be a law allowing gay couples to adopt children.

After the men exchanged a kiss, Mandroux signed the first ever marriage registry entry for two people of the same sex in France, a nation predominantly Roman Catholic but fiercely attached to the separation of church and state.

Backed by a slim majority of citizens and feted by gay men and lesbians when it came into force this month, a law making France the 14th country to allow same-sex marriage had triggered street protests by conservatives, Catholics and extreme right-wingers.

Source: Agencies