A court in Azerbaijan has sentenced 22 people to lengthy jail terms for assisting the Revolutionary Guards in neighboring Iran in terrorist plots against U.S. and Israeli targets in the oil-rich Caspian nation.

The Baku serious crimes court said Tuesday that the defendants were handed jail terms of between 10 and 15 years on charges that also included treason and the unlawful possession of weapons.

The trial was held behind closed doors.

Azerbaijani authorities said the Revolutionary Guards recruited an Azeri citizen Niyazi Kerimov while he was in Iran in 1999 and gave him the job of assembling a group of other Azerbaijanis to act as spies.

Targets for attacks were to include the U.S. and Israeli embassies as well as Western-linked groups and companies.

The 22 were arrested in March, one month after the arrest of several operatives belonging to Iranian intelligence and Lebanon's Iranian-backed Hezbollah, after being suspected of planning terrorist attacks against foreigners in Baku.