The convicts were found guilty of forming a terror cell connected to al-Qaeda and planning to carry out terror operations against oil installations inside the kingdom.
They were also convicted of having established training camps for terrorists and planning to assassinate prominent figures with the aim to destabilize the country.
Some of them were also convicted of facilitating the movement of violent extremists and terrorists into the neighboring Iraq and Syria.
Two were given 25-years jail terms, one was given 15, one 12 years, and one was given eight years. The fifth and 15th were sentenced to six years.
The Yemeni national was sentenced to prison and deportation. The 16 Saudis were banned from travelling.