PARIS — An attack on a soldier at Orly Airport near here on Saturday is being treated as a possible act of terrorism, according to the Paris prosecutor’s office. The assailant, the prosecutor said, had carried out a burst of violence over a period of two hours before being fatally shot.
The Paris prosecutor, François Molins, said the motives of the assailant — identified as 39-year-old Ziyed Ben Belgacem — were unknown. But the prosecutor added that Mr. Belgacem had a lengthy police record, including arrests for robbery and drug-related offenses, and had served time in prison. He was known to the authorities, Mr. Molins said, but primarily as a criminal.
The shooting at Orly prompted a partial evacuation of the airport, the diversion of all flights and a security sweep to determine whether the assailant had left any explosives at the airport’s two terminals, officials said. Incoming flights were diverted to nearby Charles de Gaulle Airport.
The chain of events began when Mr. Belgacem was stopped by the police at 6:55 a.m. in the Paris suburb of Garges-lès-Gonesse, after he was spotted driving at a high speed with his headlights off, Mr. Molins said at a news conference on Saturday evening.
After he pulled over, Mr. Belgacem fired a pistol loaded with birdshot and fled. One police officer was slightly injured.
Mr. Belgacem then drove to a bar in Vitry-sur-Seine, where he fired his gun again but did not injure anyone. When he exited the bar, he left his cellphone there.
He fled in his car, but abandoned it a few miles away. He then carjacked another vehicle and drove about eight miles to the airport.
There he spotted a three-soldier unit patrolling the airport, Mr. Molins said. At 8:22 a.m., Mr. Belgacem, carrying his pistol, tossed a container of gasoline on the floor. He grabbed one of the soldiers and held his gun to her head.
Mr. Molins said the soldiers reported that he yelled: “I’m here to die in the name of Allah. Whatever happens, people are going to die.”
As Mr. Belgacem grappled with the soldier, he wrested her rifle from her. At that instant, the two other soldiers fired three bursts from their weapons, killing him.
Mr. Molins said the antiterrorism unit of the prosecutor’s office and the French Intelligence Service had opened an investigation.
Mr. Belgacem was carrying cigarettes, 750 euros in cash, or about $800, a lighter and a Quran at the time of the attack, Mr. Molins said. Cocaine, a machete and some foreign currency were later found at his home.
Mr. Belgacem’s brother, father and cousin were questioned by the police, Mr. Molins said.
While in prison during 2011 and 2012, Mr. Belgacem was identified by intelligence officials as someone who had become radicalized. After his release, he remained on the authorities’ radar, and his house was searched in the wake of the terrorist attacks in Paris in November 2015, Mr. Molins said, although no action was taken against him.
The episode at Orly was reminiscent of an attack in February near the Louvre in which a man with two long knives attacked soldiers patrolling in the Carrousel du Louvre, an underground shopping mall. The man injured a soldier before being shot several times.
The attack on Saturday came amid a heated presidential election campaign in France, with the first round of voting to take place on April 23.
Any terrorist attack so close to the election, political analysts suggest, could be an opportunity by the candidates of the far right, Marine Le Pen, and the center right, François Fillon, to berate the current Socialist government and by association Emmanuel Macron, the center-left candidate, who was previously the economy minister, for failing to protect the French people.
While both Ms. Le Pen and Mr. Fillon posted Twitter messages about Saturday’s attack, they used the episode primarily as an opportunity to praise French soldiers and, in Ms. Le Pen’s case, to underscore some of her campaign themes. She said in her post: “Violence has overwhelmed France, a consequence of the laxity of successive governments. But there is the courage of our soldiers.”
Mr. Fillon limited his Twitter message to praise the “women and men” of what is known as Operation Sentinel, the soldiers who “work for our security and have once again proved their courage and efficiency.”
The unit attacked at the airport was part of Operation Sentinel, whose 7,000 soldiers patrol public areas, including airports, tourist attractions and train stations.
The west terminal at Orly reopened by 1 p.m., the Paris airport authority said. Flights gradually resumed at the south terminal, where the attack took place.