A gunman who was overpowered by passengers during a shooting on a train in France yesterday had been identified as dangerous by foreign security services and had been under police surveillance, a French source with knowledge of the case said.

Three people were wounded in the struggle to subdue the 26-year-old aboard the high-speed train from Amsterdam to Paris. He was eventually overwhelmed by passengers including two American soldiers, one of whom was hurt in the incident.

French newspaper La Voix du Nord said on Saturday that Spanish authorities had pointed out the man toFrench police. It was not immediately clear whether he was still under surveillance at the time of Friday's attack.

The source, speaking on condition of anonymity, said the gunman was being transferred on Saturday to theParis region from Arras in northern France, where the incident took place and where he was arrested.

The attacker carried two bags containing automatic weapons and knives onto the train when he boarded it inBrussels, the source said.

French Interior Minister Bernard Cazeneuve said late on Friday that the French anti-terrorism prosecutor was investigating the incident but the gunman's motives were not known. The gunman has told police he is of Moroccan origin.

French authorities have been on high security alert since January, when 17 people were killed in shootings by Islamist militants in and around Paris.

Spanish newspaper El Pais newspaper said the gunman had lived in Spain until 2014, and had been to Syria.

According to Le Voix du Nord, citing security sources, he was seen on a plane from Germany to Turkey in May this year, and was suspected of having wanted to reach Syria. The French newspaper also said he may have had connections to a group involved in a suspected Islamist shooting in Belgium in January.

President Barack Obama expressed his gratitude on Friday for the "courage and quick thinking" of the passengers, echoing similar words from Cazeneuve.

"The President expressed his profound gratitude for the courage and quick thinking of several passengers, including U.S. service members, who selflessly subdued the attacker," the White House said in a statement. "It is clear that their heroic actions may have prevented a far worse tragedy."

The wounded U.S. soldier, named only as Spencer and suffering from knife wounds, was expected to be treated at a specialist hospital for people with hand injuries in the northern French city of Lille.

President Francois Hollande's office said he would receive the passengers who subdued the gunman in the coming days.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.