Three people were injured, two seriously, after shots were fired on a Thalys high-speed train between Amsterdam and Paris on 21 August. Local media said the suspect fired a Kalashnikov in the attack, before being overpowered by two American passengers. The suspect was also armed with a knife, an automatic pistol and cartridges.
A 26-year-old Moroccan man was arrested at around 6pm local time (5pm BST), and the train was diverted to Arras, in northern France. One of the two seriously injured victims had a gunshot wound, the other a knife wound.
French media said two US marines heard the suspect loading a weapon in toilet cubicle on the train, and confronted him when he emerged. One of them was seriously injured during the attack.
]The suspect has refused to talk to police, but French media said he was known to the intelligence services.
"A man opened fire on this Thalys train between Amsterdam and Paris, one person was very seriously injured," French interior ministry spokesman Pierre Henry Brandet said on BFM-TV television soon after the attack. "Talking about a terrorist motive would be premature at the moment."
However, since Brandet's statement, counter-terrorism police have taken over the investigation. "The situation is under control, the travelers are safe. The train stopped and the emergency services are on site," train operator Thalys said on Twitter.
French Interior Minister Bernard Cazeneuve travelled to the Arras - which is 115 miles (185 kilometres) north of Paris - after the attack.
He praised the Americans who overpowered the suspect and said they were "particularly courageous and showed great bravery in very difficult circumstances." He added: "Without their composure we could have been confronted with a terrible incident."
"Everything is being done to shed light on this tragedy and obtain all the necessary information about what happened," French President François Hollande said in a statement.