Twenty-six of those convicted were handed 10-year prison terms and three others jailed for three years, the source said.
The prosecution accused the defendants of attacking a police centre in the village of Sitra, south of Manama, with petrol bombs and iron rods, wounding a policeman.
The defendants claimed in court that they were tortured and their confessions obtained under duress, the source said.
Bahrain, home to the US Fifth Fleet, remains deeply divided since after a quashed 2011 Shiite-led uprising, with persistent protests sparking clashes with police, scores of Shiites jailed on "terror" charges and reconciliation talks deadlocked.