The verdict comes amid escalated tension between Bahrain and Iran, as Manama recalled its ambassador and asked Tehran's envoy to leave last month claiming interference in its affairs.
It also came a day after Bahrain said it has uncovered a "terrorist organisation" linked to Iran and arrested 47 of its members, foiling imminent attacks in the Sunni-ruled Gulf kingdom.
The five defendants were convicted of "spying for and seeking with Iran and its agents to carry out hostile acts against the kingdom", the source said.
Two of them had received training in Iran on "the manufacture and use of explosives and firearms in preparation for carrying out these hostile attacks", according to the charges.
Three of those convicted, one of whom is in Iran, are being tried in absentia while the remaining two who appeared in court today said they were forced to confess "under torture", the source said.
Shiite-majority Bahrain has been hit by unrest since a pro-democracy uprising in 2011, and it frequently accuses predominantly Shiite Iran of meddling in its affairs.
