The criminal court also stripped the defendants of their citizenship after convicting them of "establishing and raising donations to fund a terror organisation named Bahraini Hezbollah", the source said, citing the verdict.
The group's name appears to link it to Lebanon's powerful Iran-backed Shia movement, though the verdict did not specify any connection.
Bahrain jails 8 for life over 'terrorism'
The eight defendants were accused of forming the group in 2014, possessing weapons and attempting to kill policemen in Nuwaidrat, a Shia village east of Manama.
They staged an unauthorised demonstration in Nuwaidrat in June 2014 and blocked the streets while one of the defendants opened fire at a police patrol, the judicial source said.
Two other defendants were jailed three years each for participating in the demonstration.
In another trial, a Bahraini court jailed 13 people to 15 years each after convicting them of the attempted murder of policemen who came under attack when assailants hurled Molotov cocktails at a patrol.
Twenty two others were jailed for three years each in the same case, while five others were acquitted, a prosecution statement said.
The verdicts are the latest in the series of rulings meted out against members of Bahrain's Shia majority, and it came days after authorities suspended the main opposition Al-Wefaq group.
UN Secretary-General Ban Ki-moon voiced concern on Thursday over Bahrain's crackdown against the opposition.
He is also "dismayed" by reports that human rights activists have been intimidated and stripped of their citizenship, a UN statement said.
Ban said "the current actions against the opposition may undermine the reforms undertaken" and "lessen the prospect of an inclusive national dialogue in the interest of all people of the kingdom."
Bahrain arrests 8 'terrorists' fleeing to Iran by speedboat
Bahrain re-arrested human rights defender Nabeel Rajab on Monday and in May a court more than doubled the jail sentence passed against Al-Wefaq chief Sheikh Ali Salman.
Home to the US Navy's Fifth Fleet, Bahrain has been shaken by unrest since security forces crushed a 2011 uprising demanding a constitutional monarchy and an elected prime minister.
Protesters still frequently clash with police in Shia villages outside the capital.
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