Angry victims of the 2004 Madrid train bombings have vowed to appeal over what they see as the trial court's lenient treatment of some of the accused.
The trial's result was broadcast live on Spanish television
One victim's relative said there had been too few guilty verdicts for a crime which claimed nearly 200 lives.
The court sentenced three men to thousands of years in jail, but acquitted seven of the 28 defendants, including the alleged mastermind.
Spanish PM Jose Luis Rodriguez Zapatero said justice had been done.
But the opposition party said many questions remained unanswered.
Moroccans Jamal Zougam and Otman el Ghanoui were convicted of murder along with Emilio Trashorras, a Spaniard.
But suspected ringleader Rabei Osman was cleared over the 11 March 2004 blasts on four trains that killed 191 people and injured more than 1,800.
Twenty-one were convicted for their parts in the Islamists attacks. All 28 defendants had pleaded not guilty during the four-month trial.
Victims' groups were furious at the acquittals and perceived leniency of some of the sentences.
Alleged mastermind Rabei Osman Sayed Ahmed, known as "Mohamed the Egyptian", was found not guilty but is in prison in Italy after being convicted of belonging to an international terrorist group.
Watching the verdicts by video link under guard from a court in Milan, Ahmed, who prosecutors claimed had bragged of being the brains behind the attacks, reportedly burst into tears and prayed.
But Isabel Presa, who lost her youngest son in one of the blasts, said: "It has destroyed my life, it has condemned me and my husband to a life sentence, and these people get off scot-free."
Maria Jose Gutierrez, a Spaniard who lost her sister in the bombings, said: "There are far too few guilty verdicts for such a horrible crime."
The opposition Popular Party - which was in power at the time of the attacks - has said it supports further investigation into the attacks.
"[There are] certain details of these atrocious attacks we still think that are unknown," its foreign affairs spokesman Gustavo de Aristegui told the BBC.
"We still don't know who gave the order, we still don't know who built those bombs, and we still don't know who was the co-ordinator of these cells that carried out these attacks."
But Prime Minister Zapatero called for a line to be drawn under the attacks, urging "political parties and to society as a whole to share all our energy and work in unity to fight the terrorist threat".
The announcement of the verdict was broadcast live on Spanish television.
MADRID TRAIN BOMBINGS
Bombs killed 191 people, injured 1,841
Ten backpacks filled with dynamite and nails blew up on four packed commuter trains
Twenty-eight on trial - 19 Arabs, mostly Moroccans, and nine Spaniards
Seven top suspects blew themselves up during police raid in April 2004
Prosecutors believe bombings were an Islamist plot
All defendants pleaded innocent
The defendants, 27 men and one woman, 19 mostly Moroccan Arabs and nine Spaniards, had faced charges including murder, forgery and conspiracy to commit a terrorist attack.
Ex-miner Trashorras - who supplied the explosives - along with Zougam and Ghanoui were sentenced to up to 43,000 years in jail each.
The jail terms are largely symbolic as under Spanish law the maximum term that can be served is 40 years.
Of the nine Spaniards on trial, six were acquitted.
Seven suspected ringleaders died in a suicide blast in a Madrid apartment as police closed in three weeks after the attacks.
Investigators say the accused were part of a local Islamist militant group inspired by al-Qaeda, but had no direct links to that organisation.
They had acted to avenge the presence of Spanish troops in Iraq and Afghanistan, said investigators.