PARIS — Four men involved in a terrorist attack on a Paris-bound train in 2015 that was only foiled by the courageous action of other passengers were convicted of attempting murder, complicity and criminal terrorist association, and sentenced to prison terms ranging from seven years to life.
Ayoub El Khazzani, who is accused of being the main attacker on the train, was sentenced to life in prison. His presence in the courtroom provided a rare opportunity for prosecutors to delve into the operations of the Islamic State in Europe.
At the time of the attack, the European authorities were struggling to keep track of several thousand people in Europe who had circulated to and from Iraq and Syria, trying to join jihadist groups. Just a few months earlier, in January, terrorists killed 17 people, including 10 at the offices of the satirical magazine Charlie Hebdo, which had published cartoons of the Prophet Muhammad.
The trial of 14 people accused of aiding the terrorists in that attack ended on Wednesday with all found guilty. But the actual assailants in that case were all dead.
The attack on the train took place on Aug. 21, 2015, and was thwarted by several passengers — including three Americans and a man with dual French and American citizenship — who tackled the assailant and overpowered him after an intense hand-to-hand fight. Only one person was wounded. Mr. El Khazzani was captured and arrested.
Just three months later, on Nov. 13, 2015, jihadists loyal to the Islamic State struck again in a series of coordinated assaults that resulted in the deadliest terrorist attack in modern French history. The siege left 130 people dead, including 90 who were killed when gunmen stormed the Bataclan nightclub in Paris.
The two trials have set the stage — both in terms of the investigation into the organization of the attack and the testimony of the victims — for the much-anticipated trial next September of 20 defendants accused of involvement in the November 2015 attacks on the Bataclan and elsewhere in a case that is being brought to the court by about 1,700 plaintiffs.
“When we look at the events of Aug. 21, 2015, we realized that we escaped the worst,” a Paris prosecutor told the judges on Tuesday in the train attack trial. “When we look at the whole case, we realize that it foreshadowed a terrible and disastrous November night.”
Along with Mr. El Khazzani, an Islamic State-trained fighter of Moroccan origin, three others — Bilal Chatra, Rédouane El Amrani Ezzerrifi and Mohamed Bakkali — were tried on charges of having helped the attacker travel from Syria to Belgium and of having aided the preparations for the assault.
On Thursday, Mr. El Khazzani was sentenced to life imprisonment for attempting murder and conspiracy to commit a terrorist act. Mr. Chatra, Mr. Bakkali and Mr. El Amrani Ezzerrifi were sentenced to respectively 27, 25 and 7 years in prison. The sentences almost perfectly match those requested by the public prosecutor.
Witnesses at the trial said that shortly after the high-speed train, which was packed with several hundred passengers, had crossed into France from Belgium, Mr. El Khazzani emerged from the bathroom, bare-chested and armed with an assault rifle. His arsenal included a bag stuffed with ammunition and other guns.
According to the testimony, a French citizen, who has been identified only by his first name, Damien, was the first to tackle the attacker, quickly followed by another passenger, Mark Moogalian, who has dual French and American citizenship. Mr. Moogalian struggled with Mr. El Khazzani and was wounded by a bullet fired by the assailant, the court heard.
The three other Americans — Anthony Sadler; Alek Skarlatos, a specialist in the National Guard from Oregon; and Airman First Class Spencer Stone of the U.S. Air Force, who were all friends on a vacation — then joined the fight and managed to subdue the assailant, according to prosecutors. Mr. El Khazzani’s guns malfunctioned, the court was told, hampering his attack.
Mr. Skarlatos told the Paris court that when he first saw the gunman appear in the train car, “It felt like time stopped.” As he joined other passengers in an attempt to overpower him, Mr. Skarlatos said that the assailant had fought back furiously. First, Mr. Skarlatos said, he brandished the assault rifle, then a pistol and, finally, a box cutter in the chaotic clash.
“In my mind, we were supposed to die that day,” Mr. Skarlatos said, noting that the attack had changed his life.
Mr. El Khazzani was eventually subdued on the floor of the train carriage and bound up with a tie, prosecutors said. The train rerouted to Arras, in northern France, where the police arrested him.
The heroism of the passengers later became the focus of a Clint Eastwood movie, “The 15:17 to Paris.” Mr. Moogalian, Mr. Sadler, Mr. Skarlatos and Mr. Stone were among eight people later awarded the Legion of Honor, France’s highest award, for their roles in thwarting the attack.
Central to the trial but absent from the dock was Abdelhamid Abaaoud, an Islamic State operative based in Belgium who is believed to have planned the train attack as well as the November attacks in Paris, which he took part in. Mr. Abaaoud is also believed to have helped prepare the March 2016 attack in Brussels that left 31 people dead.
Mr. Abaaoud, who was killed by the police a few days after the November attacks, “played a major role in Daesh’s external operations,” said Gilles Kepel, a French political scientist who is an expert on Islam and the Arab world, using an Arabic acronym for the Islamic State.
Mr. Kepel said that as a “planner” of attacks in Europe, Mr. Abaaoud “systematized” the use of migration routes to smuggle jihadists into European countries and made Belgium his rear base to set up clandestine cells ahead of future attacks.
Mr. El Khazzani told the court that he was under orders from Mr. Abaaoud and that the two had traveled together to Europe from Syria. He added that Mr. Abaaoud had asked him to target American passengers on the train.
Antoine Mégie, an expert on terrorism legislation who works at the University of Rouen in northern France, said that the presence of the main suspect made the trial one of the first in France to afford “a reconstruction of the mechanisms of the attack and of the organized structure behind it.”