A court sentenced an American and 23 other people on Wednesday to prison on charges they created a terrorist cell and planned attacks on foreigners and oil pipelines.

The Saudi Press Agency reported that their sentences range from two to 27 years in prison for planning attacks against the Kingdom and its smaller neighbor, Bahrain.

The SPA report said the US national was sentenced to 17 years in prison, six of which are for cybercrimes. He was ordered deported after completing his sentencing. The years he has already spent in prison will be counted as time served.

The SPA did not release any names, did not disclose when the attacks took place and did not say when the men had been arrested. All have 30 days to appeal.

The group also includes one Yemeni while the rest are Saudi. The Special Criminal Court, created in 2008 to try terrorism cases, slapped them with travel bans after they serve out their prison terms.

Other charges against various members of the group include financing terrorism, embracing "deviant ideology", disobeying the king, using the media to support terrorism, providing shelter to wanted people and training for combat.

Countries around the world are growing increasingly concerned that battle-hardened extremist fighters are training a new generation of international fighters that could launch attacks back home. Those fears have gained urgency because of the horrific methods of Islamic State fighters in Syria and Iraq.

The Kingdom criminalized fighting in conflicts abroad this year.

The government also made sweeping arrests in recent days. Police announced Monday they had arrested 88 people suspected of being part of an Al-Qaeda cell that was planning attacks inside and outside the Kingdom.

The Kingdom was hit by a wave of attacks starting in 2003 that lasted for about two years. The attacks were launched by Al-Qaeda militants. The government responded with a massive crackdown at the time that saw many flee to neighboring Yemen.

Custodian of the Two Holy Mosques King Abdullah said over the weekend that extremists could attack Europe and the United States if there is not a strong international response to terrorism.