Sadler and Alek Skarlatos — seen here on the left and middle — were on board the train when someone confronted the gunman, who opened fire with a handgun.

>> Read more trending stories

Their other friend, Spencer Stone, then put the man in a chokehold, preventing him from firing his automatic weapon. (Video via Fox News)

Skarlatos is a National Guard specialist who recently served in Afghanistan, and Stone is an airman first class in the Air Force. (Video via NBC)

Stone also helped treat a passenger who sustained a serious neck injury during the incident. Stone remains in the hospital after the gunman pulled a knife and cut him trying to get free.

The motives of the gunman have not been officially confirmed, but officials believe he is a 26-year-old Moroccan man who was known to authorities in France, Belgium and Spain. He was identified by a French official close to the investigation as Ayoub El-Khazzani.

– The Associated Press contributed to this report. This video includes images from Getty Images.