In the first case, the five men who got the longest terms were convicted of a bomb attack in a Shia-populated village east of Manama in August last year.
The bomb exploded when a police bulldozer was clearing barricades that had been erected by protesters, the source said.
Saudi arrests Shia imam for 'glorifying' Hezbollah
In the second trial, the same court handed out jail terms of between three and 15 years to 14 Shia convicted of attacking police in Sitra, south of the capital.
They were also found guilty of possessing weapons and explosives, the source said.
The tiny Gulf state has been shaken by unrest since it quelled a month-long, Shia-led uprising demanding reforms in 2011.
Bahrain jails 8 for life over 'terrorism'
The Shia-majority kingdom, connected to Saudi Arabia by a causeway, lies across the Gulf from Shia Iran and is home to the US Fifth Fleet.
Despite the crackdown on the 2011 uprising, protesters frequently clash with police in Shia villages outside the capital Manama.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ