Another seven found guilty of involvement in the attacks in India’s financial capital were sentenced to life imprisonment by the special court, their defence lawyer told reporters.
The 12 men were convicted of murder, conspiracy and waging war against the country over the coordinated series of attacks that killed 189 people and wounded more than 800.
Defence lawyer Wahab Khan said all 12 would appeal.
“We still believe they have been framed and the court has relied on confessions and not on mitigating evidence,” he told reporters outside the court.
Seven blasts ripped through the suburban trains during the evening rush hour in July 2006.
The bombs were packed into pressure cookers and then placed in bags and hidden under newspapers and umbrellas in the trains.
In all, police charged 30 people over the bombings including 13 Pakistani nationals, who along with four Indian suspects have yet to be arrested.
Prosecutors said the devices were assembled in Mumbai and deliberately placed in first-class coaches to target the city’s wealthy Gujarati community.
They said the bombings were intended as revenge for riots in the western state of Gujarat in 2002 that left some 2,000 people dead, most of them Muslims.
Prosecutors accused militant group Lashkar-e-Taiba of being behind the 2006 attacks, although a little-known outfit called Lashkar-e-Qahhar claimed responsibility.
Over the course of the nine-year trial, the court examined nearly 250 witnesses.
The accused were represented by Shahid Azmi, a rights activist and lawyer, who was mysteriously killed by unidentified gunmen in 2010.
Wednesday’s ruling is believed to be the largest number of death sentences handed down in one go since 2006, when 11 people were sentenced to hang for perpetrating deadly bomb blasts in Mumbai in 1993.
Ten of those sentences were later commuted to life in prison, however. Only Yakub Memon, who was hanged in July, failed to have his death sentence upheld on appeal.
The men convicted on Wednesday can appeal to Mumbai’s high court and then India’s Supreme Court in New Delhi. If those appeals fail they also have the option of making a mercy plea to India’s president.
“The whole process could take a year,” terrorism and security expert Sameer Patel told AFP.
The Supreme Court has said that capital punishment should only be carried out in “the rarest of rare” cases in India, among a dwindling group of nations that still have the death penalty on their statute books.