A care centre inmate enjoys one of the benefits of rehabilitation
In a small compound on the outskirts of Riyadh, the Saudi government is exploring new ways to combat extremism.
This is still a prison, run by the Ministry of Interior and housed inside secure premises with high perimeter walls and barbed wire, but the Saudi authorities prefer to call it a "care centre" and refer to prisoners as "beneficiaries".
This is not what you would imagine when you think of a typical Saudi jail.
You cannot defeat an ideology by force. You have to fight ideas with ideas
Abdul-Rahman Hadlaq Director, Ideological Security Unit
Inside, prisoners enjoy access to wide-ranging recreational facilities including their own swimming pools, video games and table tennis.
In return for the more relaxed environment, prisoners have to attend religious education classes where Islamic scholars challenge their views.
The thinking behind the new initiative is to fight al-Qaeda's ideology by convincing militant Islamists they have a distorted view of Islam.
The Ministry of Interior oversees the new scheme and has created the Ideological Security Unit (ISU) dedicated to co-ordinating their efforts.
"You cannot defeat an ideology by force. You have to fight ideas with ideas," says Abdul-Rahman Hadlaq, ISU director.
But the centre goes beyond just debating ideas. It also encourages prisoners to express their "softer side" by running art therapy classes where inmates find alternative ways to express themselves.
Watch Shiraz Maher's Newsnight report
Saudi authorities are keen to stress that any convicted Islamist will be offered a chance at rehabilitation, regardless of past crimes.
Ahmed Shayea drove a massive truck bomb into the Jordanian embassy in Baghdad in August 2003, killing nine people and injuring more than 60.
It was the first major bombing carried out by the insurgency and was designed to announce al-Qaeda's arrival in Iraq.
Shayea survived the bombing and was held at the care centre after being repatriated from Iraq by US forces.
"I am now an enemy of al-Qaeda. I believe God saved me to deliver this message," says the former militant.
Families are also heavily involved in the rehabilitation of their loved ones. The authorities encourage them to make regular visits to the centre and inmates are allowed to make occasional visits home unescorted on the understanding that they will return later.
As Muslim extremists, the inmates would have shunned representative art
It is designed to prepare prisoners for their eventual release while building trust between them and the government. It has proved particularly relevant for Saudis being repatriated from the detention centre run by the US military at Guantanamo Bay.
After returning to the Kingdom they are typically held at the care centre for a few months before being finally released.
"It prepared me to go back into society gradually. You cannot just go from Guantanamo back to normal life. It's too difficult. Everything changed. Saudi Arabia changed. The whole world changed," says Juma Muhammad Dossari who spent six years in Guantanamo Bay.
"I have a great wife. She tells me to forget Guantanamo. She says: 'Just forget it'. She says: 'You're a new man. You have a new life. You have your family. Focus on that.' That makes me feel much better."
Ahmed Shayea received major plastic surgery after surviving his bomb attack
Since its creation no-one from the care centre has reoffended.
But the support received by prisoners on their release suggests their reasons for maintaining good behaviour might not always reflect genuine ideological change.
Graduates can typically expect the government to meet the cost of their wedding and have also enjoyed home refurbishments along with new cars.
It might sound alarming to outsiders, but most Saudis are comfortable with the arrangement.
"As a [Western] person you might question this - but when I put on my Saudi hat, I think, it was the right decision" says Khalid al-Maeena, editor of the English-language Arab News.
"We are a patriarchal society. These people are sons of the soil. When a son makes a mistake, the father forgives him and the King has pardoned them."
The centre has only been open for 18 months and most of those currently passing through it are al-Qaeda's foot soldiers, not its ideologues.
Convincing those people to change their minds might take a lot more than video games, Pepsi and ping-pong.
Shiraz Maher's report is broadcast on BBC Two's Newsnight at 2230BST on Wednesday 9 July.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.