By Elinor Shields
BBC News Online
Six months after the Madrid train blasts, Spanish investigators believe they have clarified key aspects of the plot that caused the deaths of 191 people.
Police have pieced together clues from the unexploded bombs
A total of 68 people have been arrested and 20 suspects are being held, Spanish police sources told BBC News Online.
After the former government's initial insistence that the militant Basque separatists Eta were behind the attack, an Islamic group with links to al-Qaeda is now blamed.
The core cell has been dismantled. The suspected intellectual mastermind, Rabei Osman Ahmed, is awaiting extradition from Italy. Serhane ben Abdelmajid Farkhet, a suspected co-ordinator, is dead. Another is in custody.
But while aspects of the plot may be clear, the investigation is not closed.
The judge in charge of the inquiry, Juan del Olmo, has warned there are still terror cells in Spain, which could strike again.
"(The March attacks) made Spain realise it was a frontline state and that they
need to react to that," said Professor Michael Clarke, a terrorism expert at King's College, London.
Any counter-terrorism strategy must be characterised by the "3 Ps", he said: protection, penetration and a political process, or dialogue, with groups to whom the "terrorists" appeal.
Analysts argue that the March blasts did not herald the arrival of a new threat so much as a successful attack.
The judge investigating al-Qaeda activity in Spain says the group had put down roots in the country in the mid-1990s, according to Mia Soar, Europe editor for Jane's Sentinel Security Assessments.
But observers suggest that Spanish authorities and society were taken by surprise because of their preoccupation with Eta.
Juan del Olmo says the attacks were prepared in a few months
For Professor Clarke, this left Spanish authorities "flat-footed" to a different kind of terror threat - which he characterises as small, amateur and largely ineffective groups inspired and in this case aided by al-Qaeda.
It seems that the group behind the Madrid attacks was motivated, in part, by local and historical grievances against the Spanish.
But they sought the shock-value of large-scale killings through co-ordinated attacks akin to an al-Qaeda strike.
In the aftermath of the attacks, the Spanish authorities have sought to improve their capacity to protect, penetrate and develop a political process to combat Islamic militants.
Proposed moves are said to include 20 counter-terrorist agents in Ceuta and Melilla, the Spanish enclaves in Morocco that the attacks have shown to be the gateway for Islamic militants to enter Spain.
A new anti-terrorism centre that co-ordinates the work of police and intelligence agencies is due to start in the next few months.
And observers say the new government is trying to build bridges with immigrant communities in Spain and beyond. Foreign Minister Miguel Angel Moratinos has recently announced that Spain plans to build better relations with Muslim countries as a part of its new anti-terrorist strategy.
One step is the proposed judge exchange project with Morocco - a judge from Madrid will be based in Rabat and vice versa to facilitate the exchange of information on the fight against terror and illegal immigration.
But analysts point out that Spain - along with many other countries - remains fundamentally vulnerable.
The evidence to date suggests that the Madrid attacks did not take long to plan or cost much to commit.
The perpetrators would rather die rather than surrender, as Ms Soar points out. In April seven suspects blew themselves up in a suburban Madrid apartment as police surrounded the building.
Spanish awareness may have changed, but the situation is very difficult to fight, said Casimiro Garcia, a director at Spanish newspaper El Mundo.
"It will take a long time," he said.