In the third of his series Jason Burke reports on growing tensions as clergy oppose incremental moves away from conservative IslamPart two: 'A very different society from Egypt, Tunisia or Syria' Part one: Stability, security and Iran

We did not intend to suggest that the prominent Saudi cleric Sheikh Saad bin Nasser Al Shathri, who features in the article below, is supportive of or sympathetic towards the fundamentalist beliefs of al-Qaida, or that he was feuding with King Abdullah, the ruler of Saudi Arabia. We are happy to clarify that during Shathri's interview with the Guardian in 2011, there was no discussion of KAUST or of the Saudi Arabian royal family and Shathri was not critical of them. See Sheikh Saad bin Nasser Al Shathri -v- Guardian News & Media Limited for a more detailed statement."

On a Friday at one o'clock, Sheikh Saad bin Nasser Al Shathri is leading prayers in a small mosque in an upmarket neighbourhood of Riyadh, the Saudi capital. The faithful fill two floors, listening to the cleric's sermon on the true sense of the traditional greeting "salaam aleikum" – peace be upon you. This, Shathri says, means love thy neighbour.

It is a moderate message from a man who even in fiercely conservative Saudi Arabia, home to the most rigorous strands of Muslim practice in the world, is considered a hardliner. Only 18 months ago, Shathri, 46, was fired from the country's high council of religious scholars by King Abdullah, who has ruled the kingdom since 2005.

His offence was to have criticised the king's decision to allow male and female researchers to work together at the new multibillion pound science university built on the Red Sea coast. The king had called the university, a key part of Saudi Arabia's drive towards economic modernisation, a "beacon of tolerance". Shathri retorted that "mixing [genders] is a great sin and a great evil ... When men mix with women, their hearts burn and they will be diverted from their main goal [of] education."

Shathri remains unrepentant. In an interview with the Guardian, his first with a western newspaper, he says the duty of religious scholars is to advise sovereign rulers but also "to make governors fear God if they err from the right path and to remind them of God's punishment if they continue to err".

In an implicit criticism of the hugely wealthy royal family, Shathri said the Qur'an teaches money should not be admired nor should the rich be envied. The poorer you are, he said, "the less you will have to account for in this life and the next".

Such tensions between the descendants of Abdul Aziz ibn Saud, the tribal chieftain who unified the warring states of the Arabian peninsula to form Saudi Arabia in 1932, and the country's clerics are not new. Having used fanatical Wahhabi religious fighters to conquer his new kingdom, Saud crushed their subsequent revolt and did a deal with the country's ultra-conservative clergy that has endured to this day. The religious establishment was allowed substantial independence, the control of key ministries and a share of the wealth of the kingdom. In return, in crisis after crisis, it has come to the aid of the family, buttressing its authority with fatwa – religious opinions.

So in 1991, clerics declared US troops could be based in the kingdom. After the 9/11 attacks, in which 15 of the 19 hijackers were Saudis, religious scholars in the kingdom repudiated al-Qaida's extremism, grudgingly accepted some changes to schoolbooks that encouraged intolerance, and co-operated in restricting the flow of money from Saudi Arabia to radical organisations.

This year, as demonstrations unseated leaders in Tunisia and Egypt and threatened many more, they told the faithful that protests against their rulers would be un-Islamic.

"Relations between the royal family and the clergy are very good," says Turki al-Sudeiri, editor of the loyalist al'Riyadh newspaper. But such support is often grudging. Shathri is not the only cleric to dislike the current king's moves towards incremental reform.

The most conservative part of Saudi Arabia is al-Qassim province, a 250-mile drive west across the desert plateau from the capital. Cities here have seen repeated challenges to the authority of the Saud family. There were riots when women's education was introduced in the 1960s and in the 1990s the province was a base for the "awakening" movement of radical clerics who inspired and influenced Osama bin Laden.

Here both the house of al-Saud and establishment clerics close to the current king are seen with unspoken suspicion. From al-Qassim, "Riyadh looks like Paris and [the relatively tolerant port city of] Jeddah looks like Bangkok," says one Saudi reformer.

But there is variety in even al-Qassim's conservatism.

Ibrahim al-Duwaish runs a social science institute in the small town of Ar Rass. The 41-year-old religious scholar uses an iPhone and says he enjoyed his time in the UK last year, where he admired the orderly traffic and numerous universities – although not public drunkenness at weekends.

Once a firebrand reactionary and now seen locally as a relative moderate, he says there is nothing wrong with women driving in theory but that he opposed it in practice because women taking to the road would cause too many accidents. Equally, Duwaish welcomed the change new communications technology has brought to the kingdom as the internet means he can employ women at his institute. They are able to work from home and still avoid contact with men who are not their husbands or immediate family, he says.

"If you ask women all over the world if they prefer a mixed environment or to be away from men, they would choose the latter," Duwaish, whose centre was one of the first to publish a report on domestic violence in the kingdom, told the Guardian.

As elsewhere in Saudi Arabia, Ar Rass has changed immensely since Duwaish was a child. The last four decades here have seen a huge transfer of population from the countryside to small towns and into cities, a leap in material comfort and the demolition of almost every building that pre-dated the vast oil wealth of the 1970s. Forty years ago most women and many men could not read.

But there is nostalgia for times past. Ar Rass was a "quiet town where everybody knew each other", Duwaish, remembers. "It was so pure, so quiet."

The growing number of heritage projects in Saudi Arabia indicates such sentiments are widespread. The Ar Rass municipality recently opened a "traditional" museum in the corner of a shopping mall where a former soldier wears traditional dress and makes old-fashioned coffee for visitors who sit on rugs. More than 80 visitors come every day,mainly young people curious about their heritage.

The museum is a good initiative, said Duwaish, the cleric, because "when traditions disappear overnight, people react badly".

One such reaction in recent decades has been violent extremism. Saudi Arabia was hit by a series of al-Qaida-inspired attacks between 2003 and 2004, prompting widespread reform of the security services and hundreds of people being rounded up. Some of those responsible were veterans of militant training camps in Afghanistan, others were new recruits. Recent years have been calm, however.

"The problem has now almost disappeared," said Abdulrahman al-Hadlaq, a Ministry of Interior criminologist who works on radical Islam in the kingdom. "Al-Qaida here is dying. Public awareness is much higher, security is stricter."

More than 10,000 people have been arrested on terrorism charges, sometimes on flimsy evidence, human rights campaigners say. Many senior extremists have fled to Yemen. Last week, the trial of alleged militants accused of an assault on a housing compound full of expatriates in 2003 started. Dozens of death sentences are expected.

Less serious offenders are dealt with more leniently. Hadlaq runs a team of counsellors, psychologists and clerics who work to rehabilitate former militants at a centre on the outskirts of Riyadh. Since it opened in 2007, hundreds of recently released prisoners, all convicted for militant activity, have "graduated".

Recidivism rates, Hadlaq said, were around 10% for those involved in support activities or who had travelled to Iraq to fight American troops there but approached 25% for the 123 Saudi citizens who had been incarcerated in Guantánamo Bay.

Many of these "Gitmo veterans" now head the Ministry of Interior's wanted list, according to General Mansour al'Turki, a senior official. Several are now leaders of the "al-Qaida in the Arabian peninsula" group, based in Yemen.

Yusef al'Rabesh, 32, is one "Gitmo veteran" who has been successfully "rehabilitated", however. Detained like many others by American troops in Afghanistan in late 2001, he spent seven years in US custody before being released without charge. Rabesh claims he was in Afghanistan looking for his brother, a Taliban fighter. American military authorities said he was a trained combatant.

In detention in Afghanistan and then in Cuba, "the [Americans] hit me, dragged me, chained me like a dog", Rabesh said. "We were treated worse than animals. But the rehabilitation programme took this black experience away."

On his release, the government found Rabesh a job as a manager in a taxi company, a wife in his hometown of Burayda in al-Qassim province and provided tens of thousands of dollars for the wedding. He now "better understands Islam", he says.

"There are legitimate reasons for jihad in our religion but I have learned that no private person can say that a jihad is justified. It can only be the Islamic scholars who make that decision according to certain conditions," he said.

Last week, Prince Nayef, the most conservative of senior princes and minister of interior, told a local audience that terrorism had "wronged many, damaging the image of Islam, the Arabs and in particular the kingdom of Saudi Arabia."

Nayef is head of the religious police who continue to enforce, even if less brutally and intrusively than previously, Saudi Arabia's fierce puritanism and is known to be opposed to any major social reforms in the country.

The erosion of Saudi Arabia's deep conservatism is a reality but is neither a uniform nor linear process. It is extremely unlikely even the more moderate elements within the royal family will seek to accelerate the pace of reform and risk alienating the clerical establishment. Should Prince Nayef succeed – he is currently 76, second in line to the throne and eleven years younger than the king – most analysts expect a new reactionary atmosphere.

Many Saudis will be pleased.

"You have democracy. We have our religion," said Abdallah al'Utaiba, 32, a camel dealer who listened to the news of the Arab spring uprisings on a radio in a tent in the dusty hinterland on the fringes of Riyadh. "You have lost your traditions. We have not. It is better that it stays that way."