Fifty-seven people were killed and hundreds injured in the bombings in Ahmedabad, the commercial capital of Gujarat.
The Ahmedabad court also sentenced 11 others to life imprisonment until death.
The accused can challenge the sentence in a higher court.
On July 26, 2008, about 20 bombs exploded within an hour in residential areas, markets, public transport and hospitals in Ahmedabad. Several unexploded bombs were also found.
The Indian Mujahideen — then an unknown Islamist militant group — claimed responsibility for the attacks in an e‑mail sent to some media outlets.
The Indian government declared the group a terrorist organization and banned it in 2010 after it was accused of attacking a German bakery in Pune in which 17 people were killed and dozens injured.
In the Ahmedabad blasts, 78 people were tried — one of the accused, Ayaz Saiyed, later helped the investigating agencies.
The prosecution questioned 1,163 witnesses during the trial, according to The Indian Express.
Special Judge AR Patel also ordered compensation of 100,000 rupees ( $1,337) each to the victims’ families.
In 2013, authorities had said they foiled an attempt by some of the accused to break out of jail.