PARIS — The gunman who shot and killed a police officer on the famed Champs-Elysees just days before the French presidential vote spent 14 years in prison, including for attacking other officers, Frances’s anti-terrorism prosecutor said Friday – a lengthy criminal history that gave a jolt to an already nail-biting election and fueled growing security concerns.

Yet, despite an arrest as recently as February, the 39-year-old assailant, Karim Cheurfi, had shown no signs of radicalization, Paris Prosecutor Francois Molins said, and was released for lack of evidence of a threat.

That all changed Thursday when Cheurfi, a Frenchman born in the Paris suburbs, opened fire with a Kalashnikov assault rifle on the crowded boutique-lined boulevard synonymous with French glamour, striking a police officer with two bullets to the head and wounding two others before being shot and killed by police.

Security forces found a note praising the Islamic State group at the scene of the attack, which apparently fell from the gunman’s pocket. That, along with an unusually quick claim of responsibility by the Islamic State group were the only signs that he had entered the world of Islamic extremists, Molins said. Scraps of paper scrawled with the addresses of police stations and a satchel of weapons, munitions and the Muslim holy book were discovered in his car.

Thursday’s shootings followed the arrest this week of two men in Marseille on suspicion of plotting an attack around Sunday’s hotly contested first-round presidential vote, fueling France’s worst fear: a terrorist attack as crowds gather at polling stations across the nation.

Polls suggest a tight race among the four top contenders, with far-right nationalist Marine Le Pen – who rails at France’s Socialist government for being lax on crime – and Emmanuel Macron, an independent centrist and former economy minister, in the lead.

However, conservative former Prime Minister Francois Fillon, whose campaign was initially derailed by corruption allegations that his wife was paid as his parliamentary aide, appeared to be closing the gap, as was far-leftist, Jean-Luc Melenchon.

The attack in Paris appeared a perfect fit for Le Pen and her barbed criticism of authorities she accuses of being naive on terrorism. The outcome of the election was being closely watched for signs that Europe is moving toward nationalist candidates like Le Pen.

President Trump waded into the fray Friday, asserting in an interview with The Associated Press that the attack will stoke Le Pen’s chances.

“She’s the strongest on borders and she’s the strongest on what’s been going on in France,” Trump said in the Oval Office interview.