Saudi King Abdullah on Monday decreed jail terms of up to 20 years for belonging to "terrorist groups" and fighting abroad, AFP reported.
The new law comes as part of Saudi Arabia’s struggles to deter Islamist Saudis from becoming jihadists.
"Taking part in combat outside the kingdom, in any form" will be punished by jail terms of between three and 20 years, said the decree published by state news agency SPA.
Similar sentences will be passed on those belonging to "extremist religious and ideological groups, or those classified as terrorist organizations, domestically, regionally and internationally," the decree said, according to AFP.
Supporting such groups, adopting their ideology or promoting them "through speech or writing" would also incur prison terms, the decree added.
Rights group Amnesty International sharply criticized the new legislation, saying it could be used to suppress peaceful political dissent because the law used an "overly vague definition of terrorism".
"The Saudi Arabian authorities are seeking legal cover to entrench their ability to crack down on peaceful dissent and silence human rights defenders," Amnesty's Said Boumedouha said in a statement quoted by AFP.
Saudi Arabia set up specialized terrorism courts in 2011 to try dozens of nationals and foreigners accused of belonging to Al-Qaeda or being involved in a wave of bloody attacks that swept the country from 2003.
As part of its efforts to fight terrorism, the kingdom last year opened a luxury rehabilitation center in Riyadh, featuring counseling, spa treatments and exercise for convicted Al-Qaeda terrorists.
Scores of Saudis are believed to have joined Islamist extremists fighting in Syria, where Riyadh is a strong backer of the nearly three-year rebellion against the regime of President Bashar Al-Assad.
The Saudis have reportedly been providing the rebel groups that are considered to be moderate with anti-tank missiles.
Last week it was reported that the U.S. Congress had approved funding for light arms for the moderate rebel groups in Syria.