The court gave a fifth man 10-year prison sentence in the same trial, the BNA news agency reported.
All of the men were accused of blowing up a car in November 2013 near a financial centre in the capital Manama "to disrupt a Formula 1 race," the agency said.
They were also accused of making and possessing explosives, detonating explosives and stealing a car, all with the aim of "carrying out a terrorist act," the agency added, saying the men admitted their responsibility.
The tiny Shiite-majority but Sunni-ruled Gulf kingdom remains deeply divided three years after authorities quashed the Shiite-led uprising.
More From This Section
Persistent protests still spark clashes with the police and scores of Shiites jailed on "terror" charges and reconciliation talks deadlocked.
The authorities increased penalties for those convicted of violence last year, introducing the death penalty or life sentences for certain cases.
The International Federation for Human Rights says at least 89 people have been killed in Bahrain since the uprising began in February 2011.