Riot police fought running battles with hard-right protesters in the heart of Paris at the end of a mostly peaceful demonstration against gay marriage.

About 200 young people, many of them masked, pelted police lines with bottles, stones, fireworks and flares. The crowd – led bizarrely at one stage by a lone bagpiper – chased and beat up TV crews and press photographers. Police and gendarmes responded with tear gas and baton charges.

There were surreal battle scenes on the Esplanade des Invalides beside the foreign ministry as 200 gendarmes in riot gear formed into defensive squares to beat off attacks from running bands of protesters. Although a hard core of about 200 hard-right youths started the fighting, many hundreds of other, soberly dressed, middle-class protesters cheered them on.

Download the new Independent Premium app Sharing the full story, not just the headlines

Priests in long cassocks observed the battles without attempting to intervene. Other, more peaceful demonstrators stood in lines or circles nearby holding hands, praying and singing as tear gas and red smoke from flares swirled around them.

Earlier about 400,000 people, including many children, had defied warnings of possible far-right violence and marched in peaceful protest against France's newly enacted law permitting same-sex marriage. Twenty members of a xenophobic far-right group, "Génération Identitaire", clambered on to the roof terrace of the headquarters of the Socialist party during the afternoon and unfurled a banner calling for the resignation of President François Hollande. They were rapidly dislodged and arrested by police.

Even before the violence broke out, the government said that there had been 96 arrests, mostly for possession of weapons.

The "marriage-for-all" law, allowing gay couples to marry in town halls and adopt children, passed its final legal and constitutional hurdles earlier this month.

The first officially recognised same-sex marriage in France will take place between two men in Montpellier on Wednesday.

The passage of the law, and warnings of possible violence, had been expected to dampen the ardour of protesters for what was billed as the "last demonstration" in a series of half a dozen large rallies that began in December. Police put the turn-out at 150,000. The organisers claimed 1,000,000. Other organisers estimated over 400,000, which seemed closest to the mark.

Same-sex marriage has provoked the most prolonged and powerful right-wing demonstrations in France for three decades. Since the law was passed, the movement has begun to splinter into moderate and extremist wings.

One of the principal leaders of the protests, the satirist turned activist Frigide Barjot stayed away from her own demonstration after receiving a flurry of death threats from extremist homophobes who accused her of being too moderate and a government "stooge".

"Frigide was wrong not to come," said Alain, 38, a lawyer who was demonstrating with his wife and two young sons. "The threat of violence is nothing in comparison to the threat we face from this law. This is just the beginning of a programme of legislation to impose the socialist ideology of one gender and to destroy the foundations of the family."

Many of the banners and signs in the protests made similarly apocalyptic claims about the importance of the law. The largest of the marches, starting in the well-heeled 16th arrondissement of Paris, was led by a 30ft-wide banner that proclaimed: "No to a change of civilisation."

The marchers insist that the real damage will come not from gay marriage but from allowing same-sex couples to adopt.

This, they say, will trample the fundamental principle that every child should have a mother and a father. It will also, they insist, blur or destroy the concept of "filiation" or parental origins and lead to a shallow, rootless, immoral society. As a result, many slogans appeared to complain about adoption or single-parent families as much as against gay marriage. "No, to the anonymity of origins" said one large banner held by 20 people.