At the end of a four-month trial, 21 of the 28 defendants were convicted on at least one charge for their role in Europe's worst Islamist attack, in which 191 people were killed and more than 1,800 injured when bombs hidden in duffle bags ripped through four crowded commuter trains.

The attacks were Spain's equivalent of September 11, a day of chaos and confusion as frantic relatives rang mobile phones which went unanswered amid the carnage. The government of José María Aznar, an ally of George Bush, initially blamed the Basque separatist group Eta, despite evidence of Islamist involvement. Three days later he and his People's party were toppled by an electorate which believed it had been misled.

Yesterday, the heavily guarded courtroom was packed with victims' relatives. Some shouted abuse at the accused, who were held in a bullet-proof chamber, but silence descended as Judge Javier Gómez Bermúdez read his hour-long verdict.

Many felt the true ringleaders had escaped justice by blowing themselves up at a safe house near Madrid as police moved in three weeks after the massacre.

Moroccans Jamal Zougam, who planted at least one bomb, and Otman el-Gnaoui, who helped to transport the dynamite, were sentenced to 42,922 years and 42,924 years in prison respectively for each of the 191 murders. Under Spanish law the maximum sentence that can be served is 40 years. Spaniard Emilio Suárez Trashorras - who supplied dynamite in return for drugs - was sentenced to 34,715 years, but is expected to serve less than 40 years.

Rabei Osman, known as "the Egyptian", was acquitted. He was accused of being central to the plot, but the only evidence presented against him was a wiretap recording by Italian police in which he appeared to claim to have been the mastermind behind the attacks. His lawyer convinced the judges that he had been mistranslated and Mr Osman condemned the attacks during the trial. He watched the verdict from a court in Milan, where he was convicted of membership of a terrorist organisation.

Victims' relatives expressed shock at the verdicts. Pilar Manjón, who lost her son, said: "I'm not happy that killers are walking free." But the prime minister, José Luis Rodríguez Zapatero, who came to power in elections three days after the attack, said he was satisfied: "Justice was rendered today." He added: "The barbarism perpetrated on March 11 2004 has left a deep imprint of pain on our collective memory, an imprint that stays with us as a homage to the victims."

Youssef Belhadj, Hassan el-Haski, Abdelmajid Bouchar and Rafa Zouhier were acquitted of murder, but found guilty of membership of a terrorist organisation or trafficking in explosives. They were sentenced to between 10 and 18 years. Fourteen others were convicted of lesser charges, such as belonging to a terrorist group.

Zougam and Gnaoui were named as being responsible for placing the bombs, alongside seven people who blew themselves up in the Madrid flat. One other man, whose remains were found at the flat, was found to be a member of the 10-man cell. He has never been identified. Among the dead at the flat were Serhane Ben Abdelmajid, said to be the mastermind, and Jamal Ahmidan, a drug dealer turned fundamentalist, who is believed to have provided the driving force.

Spaniards were divided after the Aznar government initially blamed Basque separatists. Yesterday Judge Gómez said there was no proof of Eta's involvement.

The People's party leader, Mariano Rajoy, said the verdicts would not end the investigation into those responsible for the bombings, saying that his party would "support any further [investigation] without limits ... to find justice".

Analysts say the Madrid bombings were different in style from previous attacks claimed by al-Qaida, and the investigation found no evidence of a direct operational link to the Islamist terrorist group.

It appears that the bombers were inspired by al-Qaida's world vision. but did not receive funding or strategic help. Scott Atran, a US academic who has closely followed the trial, compared the bombers to the "home-grown" terrorists who carried out the 2005 London bombings. "We are now in a new wave of jihad - less educated, less ideological," he said.

Experts say this is partly because the US authorities have been successful in cutting off funding to al-Qaida after September 11 2001, meaning that jihadi groups have to find money where they can. Criminal networks are the only clandestine operations that offer access to money and equipment. Prosecutors estimated that the Madrid bomb attacks cost about £36,000, a large part of which was funded by Ahmidan's drug dealing.

Key players

Jamal Zougam

Displaying little emotion throughout the trial, but showing a detailed understanding of the investigation, the 34-year-old Moroccan was found guilty of placing at least one of the rucksack bombs on a train. A phone salesman, he ran the shop in the Lavapiés neighbourhood of Madrid where most of the mobile phones used to set off the bombs came from. It was a fingerprint on a SIM card attached to an unexploded bomb that led to the man who had sold phones used in the attacks and eventually on to Zougam.

Rabei Osman

Accused of being one of the masterminds, but evidence against him was weak. The 36-year-old is now in Milan, serving eight years for being a member of a terrorist gang. Many experts believe he was a show-off caught on an Italian wiretap boasting of his responsibility for the 11-M attacks.

Serhane Ben Abdelmajid

Also known as "the Tunisian", he is believed to have been the spiritual leader of the men who carried out the attacks. A scholarship student who moved to Spain in 1996, he later found solace in religion. He recruited young Muslims to the fundamentalist cause in Madrid's mosques. It was his relationship with the more hot-headed Jamil Ahmidan that was at the heart of the bomb plot. He blew himself up, along with seven others, in a Madrid flat three weeks after the bombings.

Jamal Ahmidan

Known as "the Chinaman", he was a Moroccan drug dealer turned fundamentalist, and is thought to have been the "action man" in the bombing. It was money from his drug dealing that enabled the group to procure dynamite. In 2000 he was jailed in Morocco for murder. Friends claimed that it was during this time that he become radicalised. Blew himself up in the flat in Madrid after the attacks.

Othman el-Gnaoui

Believed to be the right-hand man of Ahmidan, the 32-year-old el-Gnaoui was found guilty of carrying out the bombings and suspected of helping procure explosives. Police first started tapping his phone conversations as part of an investigation into drug dealing. He took part in a hunger strike during the trial in protest at what he and some of his fellow defendants described as the unfair role played by party politics and the media.

Javier Gómez Bermúdez

The bald, gym-going judge was widely respected in Spain for the harsh-but-fair manner in which he handled the trial. He would regularly slap down defendants who tried to use the courtroom as a stage and those lawyers who attempted to bring party politics into the trial. The way in which he knocked down the theory that Eta was involved in the bombings in his verdict showed he had little time for conspiracy theories. Judge Gómez is married to a journalist who is expected to publish a book about the 11-M trial.