A gunman on a security watchlist has killed at least two people and wounded at least 11 others near the Christmas market in the French city of Strasbourg, before fleeing.
With France still on high alert after a wave of attacks commissioned or inspired by Islamic State militants since early2015, the counter-terrorism prosecutor opened an investigation.
Amid fast-moving and confusing scenes, it was not clear if the suspect, identified by police as Strasbourg-born Chekatt Cherif, 29, had been cornered by commandos or had slipped the drag net.
Medics at the scene and police sources told journalists that four people had been killed.
But in a statement at 10.15pm, the local prefecture was still saying two people had died.
The attack began at about 8pm as stallholders prepared to close down and the city's restaurants filled up.
Bystanders were swiftly ushered into nearby shops.
A source close to the operation said the suspect had been cornered and shots had been fired.
But an hour or so later, a police source said he was still on the run.
The European Parliament, which is sitting in Strasbourg this week, was put into lockdown.
Strasbourg lies on the west bank of the Rhine river. On the opposite side, German police tightened border controls, officials said.
Interior Minister Christophe Castaner said the gunman was known to security services, and the local prefecture said he was on an intelligence services watchlist.
Security was tight this year for the Christmas market, popular with visitors to the city's old quarter, with its Gothic cathedral and half-timbered houses.
Unauthorised vehicles were excluded from surrounding streets during opening hours and checkpoints were set up on bridges and access points to search pedestrians' bags.
The Paris prosecutor said the motive for the attack was not known.
No one immediately claimed responsibility but the US-based Site intelligence group, which monitors jihadist websites, said Islamic State supporters were celebrating.
Sources familiar with the police operation said the suspect's home had been raided earlier in the day in connection with a robbery during the summer, but he was not found there.
President Emmanuel Macron was being updated on events, an Elysee Palace official said.
Mr Castaner was on his way to Strasbourg.
Jean-Claude Juncker, head of the European Commission, the EU executive, tweeted: "My thoughts are with the victims of the Strasbourg shooting, which I condemn with the utmost firmness. Strasbourg is an excellent symbol of peace and European Democracy. Values that we will always defend."
City authorities said the market and all cultural attractions would be closed on Wednesday.
Some 26,000 individuals suspected of posing a security risk to France are on the "S File" watch list, of whom about 10,000are believed to have been radicalised, sometimes in fundamentalist Salafist Muslim mosques, online or abroad.
A spokesman for the European Parliament said the building had been shut down and staff ordered to stay inside.
Police in Germany have said they are strengthening controls at the Franco-German border near Strasbourg.
The police force of Baden-Wurttemberg, a state in south-west Germany bordering Strasbourg, tweeted they were taking the extra measures at the border because of the shooting.
Lights have been dimmed in our restaurant in #strasbourg blinds down doors locked people away from window but everyone calm.— Karen Coleman (@karencolemanIRL) December 11, 2018
The European Parliament building in Strasbourg, which is situated 3.4km from Place Kleber - where tonight's shooting incident took place - is under lockdown.
The parliament is still in session.
Shooting incident in Strasbourg city centre at the Christmas markets. European Parliament building is now in lockdown pic.twitter.com/tK6BKqIJBA— Conor McMorrow (@ConorMcMorrow) December 11, 2018
Sinn Féin politician Martina Anderson, a Member of the European Parliament representing Northern Ireland, tweeted: "We were in the centre of Strasbourg town when gun shots went off."
"My thoughts & prayers with all who are injured."
Several other MEPs tweeted to say that both they and their staff were safe and accounted for.