The defendants were convicted of “forming a terrorist cell” to target American forces in Qatar with hand grenades, rockets and other weapons, official media said after Tuesday’s verdicts.
They also planned to attack US forces in Kuwait, the Saudi Press Agency (SPA) reported.
The group intended to send someone to Iraq to learn how to make vehicle bombs that could target foreign soldiers, it said.
A specialised terrorism court sentenced the Qatari to 30 years in prison, while the Afghan received five years.
Eleven Saudis were jailed for between 18 months and 25 years.
The defendants were among 41 people who allegedly belonged to the cell.
SPA did not say when the operation was to take place but authorities in 2011 established specialised tribunals to try Saudis and foreigners accused of belonging to Al-Qaeda or of involvement in deadly attacks in the kingdom from 2003-2006.
The Asharq Al-Awsat newspaper identified the Qatari as the “emir of the cell.”
The latest convictions come with Qatar and Saudi Arabia participating alongside several other Arab states in US-led air strikes against Islamic State group extremists in Syria.
American warplanes have also bombed IS in Iraq, reportedly flying out of air bases including Ali al-Salem Air Base in Kuwait and al-Udeid Air Base in Qatar, which is also home to a vital US air combat command centre for the region. – AFP