Two Russians suspected of plotting a terror attack in Europe have been charged in Spain with belonging to an unnamed terror organisation and possession of explosives, and placed under indefinite detention.
The judge who approved the charges on Sunday also said a Turkish engineer who worked in Gibraltar for years and was arrested in the same case had paid for Spanish paragliding lessons for the men.
The court named the Russians of Chechen descent as Eldar Magomedov, who also goes by the name Ahmad Avar, and Mohamed Ankari Adamov and said in a statement there was evidence linking them with "belonging to or forming part of a terrorist organisation".
The "terrorist" group was not specified, but Spanish authorities previously said it was al-Qaeda, and the Islamic network has many affiliates.
Judge Pablo Ruz, who ordered the two Russians jailed pending trial, based his decisions on information provided by US, French, Russian and Gibraltar authorities.
He said he could see connections between the two Russians and other people investigated for terrorist group ties.
According to Spanish court documents, US authorities provided information showing that Magomedov had participated in "terrorist activities" in Waziristan, Pakistan and Afghanistan since 2010.
Russia also supplied "information linking the detainee to terrorist organisations of an international character, locating him from 2010 on Pakistan and Afghanistan territory," said the documents.
The Turkish man was identified as Cengiz Yalcin, who was ordered detained on Friday after Spain's interior minister said investigators had evidence suggesting the trio were planning attacks in Europe.
The judge accused Yalcin of "possession of explosive substances and devices with terrorist aims", but did not agree with prosecutors that the man belonged to a terrorist group.
The two Russians have denied the allegations against them and say they came to Spain to seek asylum.
Yalcin's lawyer said his client was an engineer with an international company who had lived for seven years in Gibraltar and had a British work permit.
The two Russians were arrested on Wednesday as they headed on a bus for the French border. The Turk was arrested in a flat in the southern province of Andalucia, where police discovered the explosives.
After the men were arrested on Wednesday, Interior Minister Jorge Fernandez Diaz said investigators had a "clear indication" they had been planning an attack in Spain or elsewhere in Europe.
He called the suspects "extremely dangerous people," including one who was "a very important operative in al-Qaeda's international structure".
The judge's decision, released on Sunday, said video evidence seized from Yalcin could "rationally suggest the preparation" of an attack and that the explosives found in the Turk's home had a "seriously deadly potential."
Given the links between the three men since May, and given that Yalcin had "paid for the travel expenses and journey to Spain" for the two Russians, the judge decided to also charge the two for possession of explosives.