Clashes have broken out between protesters and riot police near France's National Assembly building, hours after the country legalised gay marriage.

Some protesters opposed to the measure clearing same-sex marriage hurled petrol bombs, and riot police responded with tear gas at the Invalides memorial and museum complex, near the National Assembly in Paris.

Hours earlier, French politicians concluded a wrenching national debate that exposed deep conservatism in the nation's heartland and tapped into intense discontent with the Socialist government.

The measure passed easily in the Socialist-majority Assembly, by 331 votes to 225.

Following the vote, members of the gay and lesbian community flocked to a square in central Paris, just behind City Hall, to celebrate.

France's justice minister, Christiane Taubira, said the first weddings could be as soon as June.

Opponents of the law say France is not ready to legalise adoption for same-sex couples, and polls show a France sharply divided on the issue.

Thousands of police mobilised ahead of the vote.

France is the 14th country to legalise gay marriage, and the vote came a week after New Zealand - with very little controversy - allowed same-sex couples to wed.