The man who boarded a high speed Paris-bound train armed with a Kalishnikov before being subdued by passengers was on the radar of authorities in at least three countries, had ties to radical Islam and may have traveled to Syria, authorities said.

A French official close to the investigation, who spoke on condition of anonymity because the investigation was ongoing, identified the attacker to The Associated Press as Ayoub el-Khazzani, 26, who was known to authorities in France, Belgium and Spain.

Officials didn’t disclose a possible motive for the Friday attack, but Interior Minister Bernard Cazenueve said Spanish authorities had advised French intelligence about the suspect because he belongs to the “radical Islamist movement.” Three people were injured but no one died in the attack. Authorities have credited brave American, French and British passenger with stopping El-Khazzani, who they said was armed with the assault rifle, nine magazines, a pistol and a boxcutter.

El-Khazzani was being questioned by French counter-terrorism police who on Saturday who confirmed through fingerprints their suspicions that he was the same man who had been brought to their attention in February 2014, a French official told The Associated Press. French authorities said he had lived in the southern Spanish city of Algeciras, frequenting a mosque which is under surveillance there. He was transferred Saturday morning to anti-terror police headquarters outside Paris and could be held for up to 96 hours.

Fox News couldn’t immediately confirm the reports.

There were discrepancies between French and Spanish accounts of the gunman’s travels.

An official linked to Spain’s anti-terrorism unit told The Associated Press the suspect lived in Spain until 2014, then moved to France, traveled to Syria and returned to France once more.

The French close to the investigation told The Associated Press the French signal “sounded” on May 10 in Berlin, where El-Khazzani was flying to Turkey. The French transmitted the information to Spain, which advised on May 21 that he no longer lived there but in Belgium. The French then advised Belgium, according to an official close to the investigation, but it wasn’t clear if any action was taken.

Cazenueve said El-Khazzani had the Kalishnikov strapped across his shoulder when a French citizen trying to use the toilet encountered him and tried to subdue him. As bullets started to fly, two American servicemen, with help from a Briton, tackled and disarmed him.

The Briton, businessman Chris Norman, said he was working on his computer when he heard a shot and glass breaking and saw a train worker running. Three Americans— U.S. Airman Spencer Stone and National Guardsman Alek Skarlatos from Roseburg, Oregon, and their friend, Anthony Sadler, a senior at Sacramento State University in California — heard glass breaking at the same time.

"I knew we had to do something or he was just going to kill people," Skarlatos told Oregon television station KEZI. "I mean he wasn't shooting at the time so I figured it was a good time to do it."

Sadler told The Associated Press that they saw a train employee sprint down the aisle followed by a man with an automatic rifle.

"As he was cocking it to shoot it, Alek just yells, 'Spencer, go!' And Spencer runs down the aisle," Sadler said. "Spencer makes first contact, he tackles the guy, Alek wrestles the gun away from him, and the gunman pulls out a box cutter and slices Spencer a few times. And the three of us beat him until he was unconscious."

Norman said he was the fourth to jump into the fray, grabbing the gunman's right arm and tying it with his tie.

Video showed a blood-spattered scene on the train, with the gunman prostrate and shirtless, his hands tied behind his back. Authorities say the man also was armed with nine loaded magazines for the weapon. Skarlatos, who served in Afghanistan, said that when he examined the assault rifle, he found that the gunman had tried to fire it but that it didn't go off because it had a bad primer.

Sadler said the gunman remained silent throughout the brief incident. But with the weapons he carried, "he was there to do business," Skarlatos said in an interview shown on French television.

French actor Jean-Hugues Anglade, who cut his finger it to the bone while activating the train's emergency alarm, heaped praise on the Americans, recounting the high emotion of the episode to Paris Match.

"I thought it was the end, that we would die," he said. "Yes, we saw ourselves dying because we were prisoners in this train and it was impossible to escape the nightmare."

The train, in Belgium, was rerouted to Arras, France, where El-Khazzani was arrested.

Stone was taken to a hospital in nearby Lille with a hand injury and an unidentified dual French-American citizen with a bullet wound who was helicoptered to another hospital in Lille.

Stone, of Carmichael, California, was released from the hospital later Saturday. A heavily guarded caravan was seen arriving Saturday night at the U.S. ambassador's residence in Paris, apparently escorting Stone and Sadler, both 23, and Skarlatos, 22. The three friends had been traveling together in Europe. President Barack Obama telephoned them Saturday to commend and congratulate them, the White House said. They and the Frenchman who first confronted the gunman are to meet Monday with French President Francois Hollande.

French authorities are on heightened alert after Islamic extremist attacks in January left 20 people dead, including the three gunmen. In June, a lone attacker claiming allegiance to Islamic radicals beheaded his employer and set off an explosion at an American-owned factory in France, raising concerns about other scattered, hard-to-predict attacks.

The Associated Press contributed to this report.