DUBAI (Reuters) - A Saudi Arabian court jailed 17 men for up to 26 years on Monday for seeking to fight in Iraq and funding militants, official media reported, part of a security crackdown in which scores have been imprisoned in recent weeks.

Worried about potential threats from citizens who have traveled to join Islamist insurgents in Syria and Iraq, Saudi Arabia has banned them from fighting abroad, donating money to any faction or sympathizing with militant ideologies.

The official Saudi Press Agency reported that the 17 were sentenced to terms of imprisonment ranging from 2-1/2 years to 26 years.

The men were charged with following extremist ideology, disobeying the country's leadership by planning to fight in Iraq, coordinating the travel of some "misled" members of society and trying to turn public opinion against the state.

The SPA report said one of the 17 was Senegalese, but did not state the nationality of the rest.

The world's No. 1 oil exporter, Riyadh is unnerved by the rapid advance in Iraq and Syria of Islamic State insurgents and fears this could radicalize some of its own citizens and eventually lead to attacks on the U.S.-allied government.

Saudi Arabia's Grand Mufti urged young people on Aug 28 to ignore calls to jihad from people representing "deviant principles", the latest salvo in an anti-militant campaign by the kingdom's religious establishment.

Saudi Arabia has detained thousands since 2003 over security offences, jailing hundreds of them.

(Reporting by Reem Shamseddine, Writing by William Maclean)