Distraught families outside the Jewish Ozar Hatorah secondary college in Toulouse Reuters

A gun used in a shooting at a Jewish school in south-west France was the same weapon used in the shooting dead of three French soldiers last week, police sources have said.

Four people, including a father and his two sons and another child, were killed at the Toulouse school on Monday. Reuters reported that French police were linking the attack with the shooting of the soldiers in Toulouse and nearby Montauban.

The French president, Nicolas Sarkozy, had said there were "similarities" between the two attacks.

Map of Toulouse shootings

Speaking in Toulouse, he said: "We are struck by the similarities between the modus operandi of today's drama and those last week, even if we have to wait to have more elements from the police to confirm this hypothesis."

The soldiers who were shot were of north African and Caribbean origin. Two of them were Muslims.

The adult victim in the most recent shooting was thought to be a rabbi who taught at the school, who died with his three-year-old and six-year-old sons. The fourth victim, aged between eight and 10 years old, was the school principal's daughter, according to Rahamim Sabag, a rabbi who works at the school, who spoke to Israeli television.

Witnesses described how the gunman entered the Ozar Hatorah school, a private Jewish secondary, at around 8.15am and opened fire on "everything that moved". He pursued some children, including a girl whose hair he reportedly pulled. He then fled through the quiet residential neighbourhood on a motorbike.

"I saw two people dead in front of the school, an adult and a child … Inside, it was a vision of horror … the bodies of two small children," a distraught father whose child attends the school told RTL radio.

"I did not find my son. Apparently he fled when he saw what happened. How can they attack something as sacred as a school?"

One pupil described to the local paper, Sud Ouest, how she had arrived for morning prayer, and heard shots ringing out. "We were really afraid," she said.

She said police had been called and children told to sit down. They were given water, and then they prayed together.

"Just because we are different doesn't mean we should be killed," said one father, in tears outside the school.

Sarkozy, who is currently on the election trail, cancelled all appointments and visited the site of the shootings on Monday. He called them an "abominable drama" and a "frightening tragedy".

He said everything would be done to hunt the killer and bring him to account.

"Barbary, savagery, cruelty cannot win. Hate cannot win. The Republic is stronger than that," Sarkozy said.

François Hollande, the Socialist candidate favourite to win the presidential election, was also en route to the city.

The French state prosecutor said there "were elements that justify us very seriously asking whether there was a link" between the school shooting and the shootings of four paratroopers in the region last week.

Luc Escodat, of the police union, Alliance, told iTele TV that one of the two weapons used in the school shooting was similar to that used in last week's attacks on soldiers.

Three members of a parachute regiment were shot in broad daylight as they stood by a cashpoint in Montauban, 28 miles (46km) north of Toulouse, on Thursday afternoon. Abel Chennouf, 26, and Mohamed Legouard, 24, died on the spot. A third soldier is in a critical condition in hospital.

The previous Sunday in a suburb of Toulouse, an off-duty member of another regiment was shot at point-blank range by a gunman on a scooter. Imad Ibn-Ziaten, 30, a marshal in the 1st Parachute Regiment, was standing next to his Suzuki 650cc motorbike outside a gym and had been wearing his helmet at the time. He was not in uniform.

The perpetrator of those "ride-by" shootings is still at large despite a wide police search and a mood of panic in south-west France.

Media reports said the suspect in the two attacks had a tattoo or scar on his left cheek.

The French government said security was being tightened at all religious sites in France, particularly around Jewish schools.

Danièle Hoffman-Rispal, Socialist MP and vice-president of the France-Israel friendship group in the French parliament, said she was "profoundly shocked" by the attack. "Whatever the motives, the perpetrator of this hateful crime can never justify, nor make anyone forget, that he is the murderer of children."