WHEN a 23-year-old Islamic extremist died in a hail of police bullets as he leapt from his balcony on Thursday, his dramatic demise irrevocably changed the course of France's presidential election.

The gunfire in Toulouse had barely stopped when the leading candidates – President Nicolas Sarkozy, Socialist front-runner Francois Hollande, and National Front leader Marine Le Pen – began firing charges and counter-charges about the seven murders the young man committed.

Sarkozy's party accused Hollande of being soft on terrorism, Le Pen said Sarkozy's government had handed France's poor suburbs over to Islamic fundamentalists, and the Socialists slammed police handling of the case. Each candidate carefully tried to avoid being seen to exploit Mohamed Merah's murders for political capital, but still sought to gain advantage from the attacks that profoundly shocked France and provoked a bout of national soul-searching.

Merah's cold-blooded shooting of three soldiers, three Jewish children and a trainee rabbi has turned the election campaign away from the core issues of high unemployment, an ailing economy and the euro crisis and taken it into uncharted waters. Commentators say it is too early to predict which way it might go, but the themes of security, a Sarkozy favourite, and national cohesion, on which Hollande focuses, are likely to compete in the run-up to the first round of voting on April 22.

One immediate effect was that Sarkozy, who has consistently trailed Hollande in the polls but who is now narrowing the gap, scaled down the divisive tone of his campaign. He had previously declared that France "has too many foreigners" but after the attacks in the south-west felt the need to ease tensions raised by the murder of Jewish children by a Muslim extremist of Algerian origin.

Far-right flag-bearer Le Pen, stuck at third place in the polls and failing to gain ground, was among the first to break the unofficial campaign truce called by most candidates since the attack on a Jewish school on Monday.

Merah, who was killed after trying to shoot his way out of his first-floor apartment after a 32-hour police siege, had a long criminal record, a history of extremism and had been arrested in Afghanistan's Taliban heartland. But despite apparently being under the nose of French intelligence agents, who had interviewed him as recently as November, he was able to assemble an arsenal of firearms and carry out three killing sprees in broad daylight at four-day intervals in the Toulouse region before he was caught.

"It seems Mr Merah had an almost caricatural profile as a suspect, a man with 15 criminal convictions, who twice went on training trips to Afghanistan and Pakistan," Le Pen declared scornfully. Le Pen, who is hoping to match her father Jean-Marie Le Pen's 2002 feat of winning through to May's second-round presidential run-off, accused the main candidates of dodging the issue of Islamic extremism.

Sarkozy responded from the presidential podium, announcing a raft of new laws to punish people who regularly consult jihadist websites or travel abroad for indoctrination. The killings allowed him to take off his candidate hat and return to his role as head of state, uniting a nation which, unlike Britain or Spain, had until now managed to avoid terror attacks since al-Qaeda's September 11, 2001 atrocities.

"Blaming society, pointing your finger at the politics or the institutions of France, is unworthy," he said in Strasbourg at his first election rally after the killings. "France is not guilty. Society is not responsible." Sarkozy is regularly accused of tacking to the hard right in order to recruit voters tempted by Le Pen's programme, which includes cracking down on immigration and pulling France out of the eurozone.

Sarkozy's rightward lurch led the Wall Street Journal to title a recent editorial "Nicolas Le Pen" and write that "even by local standards, the French President's recent burst of xenophobia is pretty cynical". No politician has openly blamed Sarkozy or Le Pen for creating an atmosphere that could have led to atrocities such as the killings by Merah, who said he wanted to avenge Palestinian children, and punish France for sending troops to Afghanistan and for banning the burqa. But Francois Bayrou, a centrist candidate who polls put in fourth place, said this week that France must "put an end to a climate of intolerance". France's Jewish and Muslim leaders complained this month they were being used as pawns in the election, after Le Pen then Sarkozy and finally Prime Minister Francois Fillon criticised the production of halal and kosher meat.

France is home to Western Europe's largest Muslim community, which numbers at least four million, and its largest Jewish community, estimated at up to 700,000. The country has for years been debating how far it is willing to go to accommodate Islam, now France's second religion, and Sarkozy and Le Pen had both made the matter central to their campaigns. In the presidential election of 2007, Sarkozy beat off his Socialist rival Segolene Royal, who was then Hollande's partner, in a campaign in which he focused largely on security.

It will be to his advantage if, after the Toulouse killings, the current election debate turns to security issues. Sarkozy won kudos when, as a young mayor in the posh Paris suburb of Neuilly, he personally intervened to help resolve a hostage crisis in a nursery school. He is at his best when crisis-managing and this week's events may enable him to boost his argument that he is a steady hand that can steer the country through terrorist attacks and economic crises alike.

An opinion survey on Friday said 76% of French people thought Sarkozy had handled the Toulouse crisis well, with 56% approving Hollande's performance. Sarkozy regularly lambasts Hollande's total lack of ministerial experience and says that an unseasoned president is not the right man to have when Europe is going through its worst economic crisis in decades. But the debate could now just as easily turn to national values and the cohesion of French society, which would put the president and his National Front rival at a disadvantage.

Hollande, whose recent call for a 75% tax rate for top French earners briefly dominated the electoral debate, has sought to distinguish himself from his right-wing rivals by offering a more inclusive vision of French society. The first poll conducted since Merah carried out his final attack on Monday showed Sarkozy moving ahead of Hollande in the first round, but still predicted that Hollande will win the second round on May 6. But the survey was carried out before pressure started growing on Sarkozy's government to explain how a young man who was on the US "no-fly" list as a terrorist threat, was allowed to operate freely in France.

Pollster Frederic Dabi of Ifop said it was too soon to say whether the shootings might bring Sarkozy back into the Elysee Palace. It remains possible, he said, that after the crisis has blown over voters would return to Hollande and his promises to ease Sarkozy's economic austerity measures. "No-one at this stage can tell which hypothesis will prevail," said Dabi.