Spain's interior minister has named an Islamist extremist group as a focus of the investigation into the Madrid bombings on 11 March.
Eighteen people are being held over the attacks
Angel Acebes said the Moroccan Islamic Combatant Group was the "investigators' priority".
The group has been named before in media reports but it is the first time authorities have publicly acknowledged suspicions about a specific group.
Eighteen suspects are being held over the attacks, which killed 191 people.
Mr Acebes said: "Our investigation is focusing on two strands: determining the leaders of the organisation and links to terrorist and fundamentalist groups, particularly the Moroccan Islamic Combatant Group."
"Other options are not being ruled out, but primarily the investigation is going to go in this direction," he told a news conference.
Mr Acebes said among those detained were several alleged authors of the attacks and several accomplices with various degrees of responsibility.
According to the US State Department, the Moroccan Islamic Combatant Group emerged in the late 1990s.
It says the group's aims include establishing an Islamic state in Morocco and that it supports al-Qaeda's holy war against the West. It says the group is based in Afghanistan, western Europe and possibly Morocco itself.
Reports suggest the Moroccan Government has also been investigating the group. Ten of the suspects in Spanish detention are thought to be Moroccan.
The rest are Syrians, Spaniards and Indians, Mr Acebes said.
Fourteen of the suspects detained now face provisional charges over the attacks, which allow them to be held for up to two years while investigators gather evidence.
Provisional charges were laid against two detainees early on Tuesday at Madrid's high court by Judge Juan del Olmo.
Basel Ghayoun, a Syrian, was accused of mass murder and belonging to a terrorist organisation. Hamid Ahmidam, a Moroccan, was charged with collaborating with a terrorist organisation.
Both men say they are innocent.
On Monday three more people were arrested, bringing the total number of suspects in police custody to 18, of a total of 23 detained in the investigation.
The court released three men without charge on Tuesday morning.