Ayoub El Khazzani, a Moroccan national, has been charged with attempted murder of a terrorist nature and remanded in custody, according to the prosecutor's submissions.
Earlier Tuesday, Paris prosecutor Francois Molins said Khazzani had boarded a high-speed train in Brussels Friday armed with a Kalashnikov assault rifle and 270 rounds of ammunition, as well as a Luger pistol, a bottle of petrol and a box-cutter.
The 25-year-old walked out of a toilet cubicle armed and topless before being wrestled to the floor and subdued by two young American off-dutyservicemen, their friend and a 62-year-old British consultant who have since been given France's top honour, the Legion d'Honneur.
A Franco-American man was shot and wounded in the attack.
Khazzani's claims that he was only planning to rob passengers were "barely credible", said Molins, adding that he had grown increasingly evasive in his responses to police and stopped responding entirely on Monday.
Molins outlined a raft of evidence indicating why Khazzani was being probed for "attempted murder" as part of a "targeted and premeditated" terrorist plot.
(French President Hollande rewards the American heroes for their bravery. Photo: AFP)
This included the fact that Khazzani flew back in June from a town in southern Turkey -- "a possible passageway into Syria" -- and that he watched a video "calling for violent acts in the name of radical Islam" on his phone prior to launching the attack.
Molins also raised suspicions about how Khazzani was able to afford a €149 ($171) first class train ticket, given his claims to be sleeping rough in Brussels.
Ticket sellers at the station have told investigators that Khazzani paid in cash and turned down an earlier journey where seats were available, which Molins said was an indication the attack had been carefully planned in advance.
He also dismissed as "absurd" claims by the suspect that he found the stash of weapons and mobile phone in a park where he was sleeping rough the night before.
And he said that Khazzani's Facebook page had mysteriously been disabled on Saturday -- the day after the foiled attack.
The judicial source said Khazzani was also charged with weapons offences related to terrorism, and "participation in a terrorist association with a view to organising one or several damaging crimes".
(Police at the scene in Arras, northern France. Photo. AFP)
Gaps in back story
In footage caught by the iTele network, Khazzani was seen arriving at the Paris courthouse on Tuesday flanked by policemen, barefoot, handcuffed and with a mask over his eyes.
He had been on the radar of several European intelligence agencies, but several gaps remain in his back story.
He lived in Spain for seven years until 2014, where he came to the attention of authorities for making hardline comments defending jihad, attending a radical mosque in the port of Algeciras and being involved in drug trafficking.
Molins said he had also spent time in France in 2014 working for mobile phone operator Lycamobile -- a detail confirmed by the head of the firm who said Khazzani stayed for two months and left because he did not have the right work papers.
In May this year, he came to the intelligence services' attention once more when German authorities warned he had boarded a plane for Turkey, seen as a possible sign that he travelled to war-torn Syria.
In June, he landed back in Albania, and on Friday, Khazzani boarded the Amsterdam-Paris train in Brussels.
Belgium has also opened a probe into the attack, with police carrying out searches at the homes of Khazzani's sister and one of his friends in Brussels, where he was believed to have spent several days.
Prosecutors said police had also questioned his sister, who was later released.
(Forensic police at the Arras train station in northern France. Photo: AFP)
France has been on high alert since three jihadist gunmen went on a killing spree in and near Paris in January, leaving 17 people dead.
"We are still exposed," French President Francois Hollande warned Tuesday.
"The aggression that took place on Friday... which could have degenerated into a monstrous carnage... is fresh proof that we must prepare for other attacks and therefore protect ourselves."
Meanwhile, the Californian capital Sacramento said it would hold a parade of honour for the three young Americans who tackled the gunman: Alek Skarlatos, a 22-year-old National Guardsman, Spencer Stone, a 23-year-old US Air Force member, and Anthony Sadler, also 23, a student at the state university.
Skarlatos will receive the US Army's highest non-combat honour, the Soldier's Medal for "extraordinary heroism above and beyond the call of duty", the military said in a statement Tuesday.
Stone has been nominated for the Airman's Medal, the US Air Force's top non-combat award for bravery.