With that kind of firepower, a massacre might have occurred if three American friends traveling together and a British passenger had not tackled, beaten and tied up the suspect, authorities said.
Of the Americans, two are U.S. servicemembers. Spencer Stone serves in the Air Force and Alek Skarlatos is a member of the Oregon National Guard. The third American is Anthony Sadler, a college student.
President Barack Obama called, commending and congratulating them for their courage and quick action, his spokesman said.
French President Francois Hollande plans to host a meeting with them Monday that will include top government ministers, his office said. Hollande spoke with them by phone and "thanked them for their exceptional courage and their efficiency to prevent a tragedy," according to a statement from his office.
The suspect was identified as Ayoub El Khazzani, a Moroccan national whose DNA was already on file with Spanish authorities, French media reported, citing French official sources. A senior European counterterrorism official told CNN the suspect was linked to investigations into radical Islamist networks.
Four people were hurt in Friday's melee -- including Stone, who was cut by the attacker. He was released from the hospital on Saturday. A passenger suffered a gunshot wound, another suffered cuts to his neck and a fourth badly hurt his hand while breaking the glass to pull the emergency brake.
Passengers thwarted the attack
The train company, Thalys, said the attack attempt occurred as the high-speed train, heading from Amsterdam to Paris, passed through the Oignies region in Haute Picardie, France. The suspect boarded the train in Belgium, Thalys said.
A French passenger who went to use the toilets in car 12 found himself face-to-face with a man armed with a Kalashnikov rifle that was strapped to his shoulder, Cazeneuve said.
"The French passenger courageously attempted to overpower him before the aggressor shot the rifle several times," Cazeneuve said. One of the rifle shots wounded a French-American passenger seated nearby.
That's when Chris Norman, the Briton seated in car 13, saw the suspect run through the carriage.
"I then stood up to see what was happening," he said. "I saw a man with what I think was an AK-47 -- anyway, it was some kind of machine gun or submachine gun. So my first reaction was to sit down and hide. Then I heard one guy, an American, say, 'Go get him' and I heard another American say, 'Don't you do that, buddy' or something like that."
Stone, Skarlatos and Sadler were traveling together when they heard shattering glass and saw people running, Skarlatos' brother Peter said. Sadler, on his first trip to Europe, said they acted right away.
"My friend Alek Skarlatos yells, 'Get him!,' so my friend Spencer Stone immediately gets up to charge the guy, followed by Alek, then myself," Sadler said.
"The three of us beat up the guy," Sadler said. "In the process, Spencer gets slashed multiple times by the box cutter, and Alek takes the AK away."
Spencer suffered cuts to his head and neck, and his thumb was almost cut off, Norman said.
Skarlatos, who joined his friends on vacation after returning from Afghanistan, seized the rifle and hit the suspect in the head with the muzzle.
Norman and Sadler tied up the suspect.
The attacker, Norman said, "put up quite a bit of a fight. But Spencer Stone is a very strong guy. He actually held him very well and Alexander and Anthony had a pretty good go at hitting him."
He added later, "The way that ... the two Americans had a go at him, he could not do much more."
Determining the suspect's identity
El Khazzani was transferred from Arras, the northern French town where the train stopped after the attempted attack, to the anti-terrorist police unit and France's external intelligence agency, the General Directorate for External Security, in the northwestern suburbs of Paris, Cazeneuve said in a press conference in Paris. The suspect is being interrogated as part of a detention that can last up to 96 hours.
The identify of El Khazzani's was established through DNA analysis and matches the DNA records Spanish authorities had on file, according to French media.
There are strong indications the suspected gunman traveled from Europe to Turkey between May and July, probably to try to join up with ISIS in Syria, a senior European counterterrorism official told CNN terrorism analyst Paul Cruickshank on Saturday.
The official said that investigators have yet to make a final determination on the suspected gunman's travel movements and it is not clear whether he had reached Syria.
The gunman was likely linked to a group of French ISIS fighters in Turkey, the official told CNN. The group is believed to have previously directed an Algerian student to launch attacks in Paris, according to the official
The student -- Sid Ahmed Ghlam -- was arrested in April 2015 as he allegedly prepared to attack churches in Paris and other targets. He was charged with terrorism offences, which he denies.
Concerns about Turkey
According to Le Monde newspaper, citing investigators, Ghlam met with French ISIS fighters in Turkey during two trips to Turkey in the months before his plot was thwarted. They allegedly directed him to launch an attack in France rather than travel to Syria, the newspaper reported earlier this month.
When Ghlam returned to France, he discussed attacking a passenger train in online conversations with the French ISIS fighters in Turkey, according to the newspaper.
According to Cruickshank, there is growing concern that ISIS operatives are using Turkey as a base to redirect European extremists trying to travel to Syria to launch attacks back home.