A shooting in the eastern French city of Strasbourg killed three people and wounded 12 others, six critically, according to France's interior minister Christophe Castaner, sparking a major security operation around a world-famous Christmas market on Tuesday.

Earlier reports quoted police sources as saying four people were dead.

"There were gunshots and people running everywhere," one shopkeeper told BFM TV. "It lasted about 10 minutes."

In the hour after the attack, which began just before 8 p.m., Castaner said police confronted the gunman twice and exchanged gunfire with him, but he was able to flee.

The city was locked down for more than five hours as police searched for the suspect. Some 350 security forces on the ground plus two helicopters are involved in the search.

Rescue teams work at the scene of shooting in Strasbourg. (Abdesslam Mirdass/AFP/Getty Images)

The shooter's motive was not immediately clear but with France still on high alert after a wave of attacks commissioned or inspired by Islamic State militants since early 2015, the counter-terrorism prosecutor opened an investigation.

Sources familiar with the police operation said the suspect was a 29-year-old whose residence had been raided earlier in the day in connection with a robbery during the summer. The suspect was not in the building at the time.

<a href="https://twitter.com/hashtag/Breaking?src=hash&ref_src=twsrc%5Etfw">#Breaking</a>: Reports of people being shot at <a href="https://twitter.com/hashtag/Chrismas?src=hash&ref_src=twsrc%5Etfw">#Chrismas</a> market in <a href="https://twitter.com/hashtag/Strasbourg?src=hash&ref_src=twsrc%5Etfw">#Strasbourg</a> <a href="https://twitter.com/hashtag/France?src=hash&ref_src=twsrc%5Etfw">#France</a>. Multiple casualties assumed. <a href="https://twitter.com/cnni?ref_src=twsrc%5Etfw">@cnni</a> <a href="https://twitter.com/breaking9111?ref_src=twsrc%5Etfw">@breaking9111</a> <a href="https://twitter.com/BBCBreaking?ref_src=twsrc%5Etfw">@BBCBreaking</a> <a href="https://t.co/5kCV7GVzor">pic.twitter.com/5kCV7GVzor</a> —@Glivenews

Strasbourg resident Yoann Bazard told The Associated Press by telephone he heard "two or three shots" and some screams before he went to a window and saw people running Tuesday night.

The 27-year-old said: "After that I closed the shutters. Then I heard more shots, closer this time."

Bazard continued: "There were two or three episodes like that. … As it got close, it was really shocking. There were a lot of screams."

Freelance journalist Camille Belsoeur says he was at a friend's apartment on the same street and at first mistook the gunfire for firecrackers.

"We opened the window. I saw a soldier firing shots, about 12 to 15 shots."

Emergency workers escort a woman after the shooting near the Christmas market in Strasbourg. (Abdesslam Mirdass/AFP/Getty Images)

In a late night briefing, Castaner said the gunman was "well known" to security services in both France and Germany. The local prefecture said he had previously been identified as a danger to security. Some 26,000 individuals suspected of posing a security risk to France are on the Fiche S watch list, of whom about 10,000 are believed to have been radicalized, sometimes in Salafist mosques, online or abroad.

Three suspects are accused of supplying an 8 mm pistol used by Cherif Chekatt to kill five people and wound 11 others at an open-air Christmas market in Strasbourg on Dec. 11. (Abdesslam Mirdass/AFP/Getty Images)

Strasbourg's well-known market is set up around the city's cathedral during the Christmas period and becomes a major gathering place. Castaner said security will be increased across the city and at borders Wednesday. Most Christmas markets will be closed for the day, he said, in order to ward off copycat attacks, but schools and colleges will be open.

The market that was the scene of the attack was being held amid tight security this year, with unauthorized vehicles excluded from surrounding streets during opening hours and checkpoints set up on bridges and access points to search pedestrians' bags.

Images from the scene show police officers, police vehicles and barricades surrounding the sparkling lights of the market.

A police officer stands guard near the scene of the shooting. (Abdesslam Mirdass/AFP/Getty Images)

The European Parliament, which is based in Strasbourg, was also locked down for the better part of the evening.

European Commission President Jean-Claude Juncker said, "My thoughts are with the victims of the shooting .... Strasbourg is like no other a city which is a symbol of peace and European democracy."

An anti-terrorism investigation has been opened. (Vincent Kessler/Reuters)

Prime Minister Edouard Philippe tweeted, "The situation is still underway, priority is given to security forces and rescuers."

President Emmanuel Macron attended a crisis briefing in Paris, but did not speak to reporters.

European security agencies have feared for some time that Islamist militants who left Europe to fight for Islamic State in Syria and Iraq would return after the jihadist group's defeat, with the skills and motivation to carry out attacks at home.

In 2016, a truck plowed into a Bastille Day crowd in Nice, killing more than 80 people, while in November 2015, co-ordinated Islamist militant attacks on the Bataclan concert hall and other sites in Paris claimed about 130 lives. There have also been attacks in Paris on a policeman on the Champs Elysée, the satirical weekly Charlie Hebdo and a kosher store.

Almost exactly two years ago, a Tunisian Islamist rammed a hijacked truck into a Christmas market in central Berlin, killing 11 people as well as the driver.