UPDATED August 22, 2015 4 p.m. PT

First they heard gunshots, then the passengers, who a few moments later would become heroes, saw a man wielding a machine gun as their high-speed train chugged through France.

Spencer Stone, a member of the U.S. Air Force, and his friend Alek Skarlatos, of the U.S. National Guard, immediately looked at each other.

"Get him," Skarlatos, 22, said. And like that, Stone, 23, jumped out of his seat, ran about 32 feet, and tackled the gunman, who had come out of a bathroom armed with an AK-47, a pistol and a knife.

Skarlatos and another friend, Anthony Sadler, a 23-year-old college student from California, quickly followed, dog piling on the attacker, who police would later identify as a 26-year-old of Moroccan descent. British consultant Chris Norman, who initially dug down in his seat when he saw the weapon, joined in to get the gunman under control. A French national, who first saw the attacker exit the bathroom, also confronted him.

Skarlatos, who is from Oregon, grabbed the gun and hit the attacker in the head, his brother, Peter Skarlatos, told CNN.

"We ended up by tying him up then during the process the guy actually came out, he pulled out a cutter and started cutting Spencer," Norman, 62, told broadcaster iTV early Saturday morning local time. "He cut Spencer behind the neck. He nearly cut his thumb off. Spencer held him and we eventually got him under control. We got the terrorist."

But Stone, who is from California, didn't stop there. While he was bleeding, he helped another injured person.

"He just went over there and saved his life," Sadler said.

Alek Skarlatos is one of the men who helped subdue a gunman on an Amsterdam-to-Paris train Friday.

After overtaking the gunman, Skarlatos patrolled the train car looking for other would-be attackers. That's when he discovered the gunman's AK-47 had malfunctioned. The man's handgun was also missing a magazine.

"He either dropped it accidentally or didn’t load it properly, so he was only able to get what appeared to be one shot off," Skarlatos told The New York Times.

Stone, who was hospitalized, was in good spirits Friday, but still astonished by the harrowing ordeal, his friends told iTV. Stone was released from the hospital, his arm in a sling, on Saturday.

Spencer Stone leaves the hopistal in Lesquin, France on August 22, 2015. Image: PHILIPPE HUGUEN/AFP/Getty Images

The other three who helped subdue the gunman were awarded medals of honor that day by a local mayor. The train had 554 passengers aboard.

"We're very lucky that nobody got killed, especially Spencer," Skarlatos said. "If anyone would have gotten shot it would have been Spencer for sure." Skarlatos told Reuters that he had recently returned from Afghanistan and was vacationing in Europe.

Hey @thalys_en Whats going on? Reports of a gun and victim. pic.twitter.com/4ycpffIzzk — FreedomFilmLLC.com (@FreedomFilmLLC) August 21, 2015

Two others were also hospitalized, including French actor Jean-Hugues Anglade, who suffered from a hand injury. Hughes reportedly hurt his hand while breaking glass to set off an alarm.

Authorities arrested the suspect once the train stopped in the French town of Arras, 115 miles north of Paris. Video from aboard the train, which has been posted on YouTube, shows the aftermath of the attack, with the suspect on the ground, his legs in the air.

"Thanks to the calm of two American passengers, we have avoided a tragedy," French Interior Minister Bernard Cazeneuve said earlier in the day.

U.S. President Barack Obama also praised the good samaritans, according to a White House statement.

“Echoing the statements of French authorities, 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.... it is clear that their heroic actions may have prevented a far worse tragedy."

Norman said if Stone wasn't quick to respond there could have been even more bloodshed on the train heading from Amsterdam to Paris.

"It could have been a real carnage, there's no question about that," Norman said, according to Reuters.