More than 700 French security forces had been hunting for 29-year-old Cherif Chekatt since the bloodshed on Tuesday night.
He was believed to have been injured after exchanging fire with soldiers during the attack, but managed to escape and had not been seen since getting out of a taxi in the Neudorf area of the northern French city.
Minutes before he was shot dead on Thursday, a helicopter with powerful searchlight flew over Neudorf.
Interior Minister Christophe Castaner told reporters police swooped after the suspect was spotted in the street.
Officers tried to arrest him, but he shot at police. “They immediately returned fire and neutralised the assailant,” Castaner said.
Dozens of police vehicles converged on the area where police were applauded after the shooting. “Bravo!” some shouted as people gathered at the police cordon, a source said.
Police in several other countries earlier joined the manhunt for Chekatt, a Strasbourg native and career criminal with at least 27 convictions in four European states.
Authorities published Chekatt s picture late Wednesday with police describing him as dangerous and urging people not to approach him.
A fifth person was detained by police for questioning on Thursday, in addition to the suspect s parents and two brothers who have been in custody since Wednesday.
The Strasbourg Christmas market is due to reopen on Friday.
French President Emmanuel Macron expressed “the solidarity of the whole country” towards the victims as he arrived for a European summit in Brussels on Thursday.
“It is not only France that has been hit… but a great European city as well,” he added, referring to the seat of the European parliament in the eastern French city that lies on the border with Germany.
As police were hunting Chekatt Thursday, the French government urged “yellow vest” protesters not to hold another round of demonstrations this weekend, given the strain on the country s security forces.
Government spokesman Benjamin Griveaux called on the anti-government protesters to be “reasonable” and not protest again Saturday, after nearly four weeks of often violent demonstrations which has led the government to offer a range of financial relief to low earners.
“Our security forces have been deployed extensively these past few weeks,” Griveaux told CNews television.
“It would be better if everyone could go about their business calmly on Saturday, before the year-end celebrations with their families, instead of demonstrating and putting our security forces to work once again,” he added.
The “yellow vest” protesters, known for their fluorescent high-visibility jackets, had called for a fifth round of protests this Saturday.
The protests began on November 17 over fuel tax increases, but snowballed into a revolt over living standards as well as Macron s perceived indifference to the problems of ordinary citizens.
Underscoring attempts to ease tensions, Prime Minister Edouard Philippe confirmed a proposed constitutional reform, which was to be debated in January, had been postponed to allow time for more discussions over local grievances.
Some union leaders also put pressure on “yellow vests” not to demonstrate on Saturday so they would not overburden police as they dealt with security after the Strasbourg attack.
But some demonstrators dismissed the calls to suspend protests.
A 23-year-old protester was killed after he was hit by a truck on a roundabout in southern France near Avignon late on Thursday, the sixth person to have died during the weeks of demonstrations.
Strasbourg s location in the heart of western Europe means that Germany, Switzerland, Belgium and Luxembourg can be easily reached by car or train, making the search for Chekatt more complicated.
Swiss police had reinforced border checks, while German authorities also widely published the photo of the suspect, which showed him with dark hair, a short beard and a visible mark on his forehead.
In 2016, a jihadist responsible for an attack on a Christmas market in Berlin was shot and killed only three days later in Milan in northern Italy after travelling through the Netherlands and France.
The Strasbourg suspect, who lived in a rundown apartment block a short drive from the city centre, was flagged by French security forces in 2015 as a possible Islamic extremist.
France has been hit by a wave of attacks from gunmen claiming allegiance to Al Qaeda or the Islamic State group since 2015, which have claimed the lives of 246 people before Tuesday s attack, according to an AFP toll.
No group has claimed responsibility for the Strasbourg attack, but social media accounts used by Islamic State sympathisers have celebrated the killings.