Pro-Palestinian demonstrators on the Republic statue in Paris. Photograph: Remy De La Mauviniere/AP

François Hollande is urging diplomatic partners to talk to Hamas and is pressing Israel for restraint in Gaza.

The conflict has fuelled tensions in France, with pro-Palestinian demonstrators clashing with security officers at a Paris synagogue on Sunday.

"Israel has the right to its security; Israel can defend itself if it is attacked; but at the same time Israel should show restraint," Hollande said in a televised interview marking Bastille Day.

A synagogue near the Bastille was under police guard on Monday after more than 100 youths chanting "Israel murderer" tried to storm the building following a march demanding an end to Israeli air strikes on Gaza.

Several thousand protesters took part in Sunday's march, some wearing facepaint in the colours of the Palestinian flag and carrying banners saying: "Stop killing children."

As the demonstration broke up, a large group headed to the Abravanel synagogue where about 150 people had gathered for a memorial service for three Israeli teenagers found murdered in the West Bank.

Neighbours said the protesters had picked up chairs from a cafe nearby and tried to break through a police barrier outside the synagogue, where worshippers remained trapped for several hours.

Six police and two members of the Jewish community were injured, and six protesters were arrested.

The prime minister, Manuel Valls, who lives in the neighbourhood, and the mayor of Paris, Anne Hidalgo, condemned the attack, and Jewish leaders said they were "shocked and revolted".

"France will never tolerate people trying in words or deeds to import the Israeli-Palestine conflict on to its territory," Valls said.

In Lille, about 6,000 people joined a peaceful pro-Palestinian march on Sunday. France has Europe's largest Arab population but also its largest Jewish community.

Israel's week-long offensive against Hamas militants in the Gaza Strip has killed more than 172 Palestinians.

Hollande has said in recent days that he has been trying "to convince those who could have an influence on Hamas, on the Gaza Strip, and at the same time putting pressure on Israel" to end the violence.

While France has no diplomatic relations with Hamas, Hollande has spoken with the Palestinian president, Mahmoud Abbas, the Turkish prime minister, Recep Tayyip Erdogan, and the Tunisian president, Moncef Marzouki.

Hollande said he did not want the Israeli-Palestinian conflict to be "imported" to France, and strongly criticised Sunday's clashes at the synagogue.

"We cannot have intrusion or efforts at intrusions into places of worship, whether they are synagogues, as happened yesterday, but I would say the same thing for mosques, for churches, or for temples," he said. "Religions should be respected, all religions. These places of worship should be protected."