The hunt for the suspect, Chérif Chekatt, 29, consumed the work of more than 700 police officers and special investigators searching in and around Strasbourg. The chase ended on Thursday night, when three police officers opened fire on Mr. Chekatt, who shot at them as they pursued him in the residential Neudorf neighborhood of Strasbourg, Interior Minister Christophe Castaner said at a news conference in the city.

Image Chérif Chekatt Credit... French Police

The police used surveillance and other information to track down Mr. Chekatt, he said.

The officers “saw an individual walking on the public street, who corresponded to the description” of Mr. Chekatt, said Mr. Castaner, adding that the man “turned around firing at them, they returned fire and neutralized the assailant.”

As he fled the market on Tuesday night, Mr. Chekatt managed to elude the police and soldiers, even though he was injured in at least one encounter with them.

The attack prompted the authorities to place France on its highest level of alert, which allowed the government to heighten border security and search cars on the main highways leading to and from Strasbourg. Some officials feared that Mr. Chekatt might flee into Germany, given Strasbourg’s location on the French-German border.

French officials also moved quickly to tighten security at other Christmas markets, dedicating additional police officers to guard them. Christmas markets are common throughout Europe, and often located in the confines of old city centers, making safety difficult to ensure.