A heavily-armed gunman who was overpowered by passengers on a packed Amsterdam-Paris train is "dumbfounded" by accusations of terrorism levelled against him, his lawyer says.
But intelligence services in several countries had nevertheless previously flagged him as a radical Islamist, and French investigators are focussing on an extremist attack.
Moroccan national Ayoub El Khazzani, 25, on Friday evening boarded a high-speed train in Brussels bound for Paris armed with a Kalashnikov assault rifle, Luger automatic pistol, nine cartridge clips and a box-cutter.
Witnesses say he opened fire, injuring a man before being wrestled to the floor by three American passengers and tied up, until the train stopped in the northern French city of Arras where he was taken into police custody.
Khazzani has denied any intention of waging a jihadist attack, saying he had merely stumbled upon a weapons stash and decided to use it to rob passengers, according to Sophie David, a lawyer assigned to his case.
"He is dumbfounded that his act is being linked to terrorism," she told BFM-TV, adding the suspect who is believed to have lived in Belgium describes himself as a homeless man.
"He says that by chance he found a suitcase with a weapon, with a telephone, hidden away," said David, who is no longer representing him as Khazzani has been transferred to Levallois Perret near Paris where he is being questioned by counter terrorism officers.
"He said he found it in the park which is just next to the Midi Station in Brussels, where he often sleeps with other homeless people."
"He says that the Kalashnikov didn't work and he was brought under control immediately without a single shot being fired," David added.
Armed with the weapons, the attacker exited a toilet cubicle on the high-speed train just after it crossed from Belgium into northern France.
A French passenger tried to disarm Khazzani - described as "small, slim, not very strong" - but he got away and fired at least one shot, wounding a Franco-American traveller in his 50s.
But the attack was quickly stopped when two off-duty US servicemen and their friend charged the gunman and restrained him.
"I looked back and saw a guy enter with a Kalashnikov. My friends and I got down and then I said 'Let's get him'," Alek Skarlatos, a 22-year-old member of the National Guard in Oregon who recently returned from Afghanistan, told France's BFMTV.
Spencer Stone, who serves in the US Air Force, was first to the gunman, who slashed him in the neck and almost sliced off his thumb with a box-cutter.
"At that point I showed up and grabbed the gun from him and basically started beating him in the head until he fell unconscious," said Skarlatos.
His friend Anthony Sadler, a 23-year-old student at Sacramento State University, and a British business consultant, Chris Norman, then helped keep the man subdued.
A Spanish counter-terrorism source said Khazzani had lived in Spain for seven years until 2014 and came to the attention of authorities for making hardline speeches defending jihad, as well as once being detained for drug trafficking.
German security services, meanwhile, flagged Khazzani when he boarded a flight from Berlin to Istanbul in May this year and in Belgium, Justice Minister Koen Geens confirmed Khazzani was "known" to the country's intelligence services.