The court convicted the pair, one in absentia, of receiving training at a camp belonging to the Iraqi Popular Mobilisation (Hashed al-Shaabi) force, an umbrella group dominated by Iran-backed Shiite organisations, the source said.
They were trained in "making and using explosives and firearms to carry out terrorist attacks such as bombings in Bahrain", the source told AFP.
Bahrain on Thursday revoked the citizenship of five Shiites after convicting them of spying for Iran and sentenced them to life imprisonment.
Bahrain last week said it has uncovered a "terrorist organisation" linked to Iran and arrested 47 of its members, foiling imminent attacks in the country.
Also Read
A foreign ministry official in Iran rejected the accusations as "baseless".
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 August, five people suspected of links with Iran were arrested in connection with a bombing in Bahrain that killed two policemen.