Fingerprint evidence shows that the gunman overpowered by passengers on a train in France is a Morrocan known to European authorities as a suspected Islamist militant, according to a source familiar with the case.
Two people were wounded in the struggle to subdue the Kalashnikov-toting attacker aboard the high-speed train from Amsterdam to Paris on Friday. Three young Americans, one of whom suffered knife wounds, were among the passengers who stopped the gunman.
French Interior Minister Bernard Cazeneuve told reporters the gunman appeared to be a 26-year-old Moroccan who had been "identified by the Spanish authorities to French intelligence services in February 2014 because of his connections to the radical Islamist movement".
Cazeneuve did not give a name, but the source named him as Ayoub el Khazzani and said he was believed to have flown from Berlin to Istanbul on May 10 this year. Turkey is a preferred flight destination for would-be jihadists heading for Syria.
According to a Spanish counter-terrorism source, Spanish authorities had a suspect they identified as Khazzani under surveillance before he left Spain for France in 2014, traveled to Syria, and then came back to France.
In Spain, he lived in Madrid between 2007 and 2010 before moving to the southern port of Algeciras. He was arrested in Spain at least once for a drug-related offence, the Spanish counter-terrorism source said.
Cazeneuve said he had also lived in Belgium and that inquiries "should establish precisely the activities and travels of this terrorist".
French newspaper Le Voix du Nord said the suspect may have had connections to a group involved in a suspected Islamist shooting in Belgium in January. The Belgian government confirmed an inquiry was under way but would not comment further.
French authorities have been on high alert since January, when 17 people were killed in shootings by Islamist militants in and around Paris.
The train attacker was armed with a Kalashnikov assault rifle and an automatic pistol, both with accompanying ammunition clips. He also had a box cutter knife. Cazeneuve said the struggle started when a Frenchman on his way to the toilet tried to stop the man entering a carriage.
The wounded American, Spencer Stone, an airman from the U.S. air base in Lajes, Azores, was treated on Saturday at a specialist hospital for hand injuries in the northern French city of Lille.
Among the other passengers who helped stop the attacker were Stone's friends: National Guardsman Alek Skarlatos and another American, student Anthony Sadler. Skarlatos had returned last month from a tour of duty in Afghanistan and the three were on holiday together in Europe.
Cazeneuve said the other wounded person was of Franco-American nationality and hit by a bullet while seated. Hospital authorities said the person had a chest wound and was in a serious but stable condition.
French actor Jean-Hugues Anglade was also slightly hurt, and had stitches in his hand.
"We were stuck in the wrong place with the right people," Anglade was quoted as saying on BFMTV. "It's miraculous."
President Barack Obama hailed the passengers as heroes: "It is clear that their heroic actions may have prevented a far worse tragedy," he said in a statement.
President Francois Hollande is due to thank them in person on Monday.
The gunman was transferred on Saturday to the Paris region from Arras in northern France where the incident took place. Cazeneuve said under the terms of his arrest the man can be held for four days without being charged.
The shooting took place on a Thalys high-speed train. The Franco-Belgian state transport group runs international trains linking France, Belgium, the Netherlands and Germany.
All four countries are part of the Schengen area through which people travel without the need for passports and security check-ins. Experts have long said the trains are a potential target for attacks.
Prime Minister Manuel Valls said in January there were more than 3,000 potentially dangerous Islamists under surveillance in France, home to Europe's biggest Muslim community.
Most of the attacks and foiled attacks this year in France have been carried out by people who were on that list, but government officials say the surveillance cannot be constant.
"When there's nothing to justify an arrest, there comes a time when you move on to other individuals," said Sébastien Pietrasanta, a Socialist lawmaker who drafted France's latest anti-terror legislation.
"Given the number of individual linked to radical Islamism its becomes complicated," he told Reuters.
"We take 100 percent precautions but that does not mean 0 percent risk."