At Jordan's State Security court, Islamic State militants, clad in green military fatigues with long, unkempt beards, stood impassively, awaiting sentence inside a black iron cage.
The barred enclosure was very much like the one in which their fellow jihadis in Syria burned alive Jordanian pilot Mouath al-Kasaesbeh, igniting a storm across a troubled kingdom in an uneasy alliance with the West against Islamic State (ISIS).
The defendants did not blink when the military judge handed down sentences ranging from three to 15 years with hard labor.
The charges were comprehensive: recruiting and smuggling arms and men to fight with terrorist groups (in Syria); promoting the ideology of a terrorist group via videos on social media; oaths of allegiance to Abu Bakr al-Baghdadi, the self-proclaimed Caliph of the Islamic State, and inducing others to follow suit.
They had no direct link to the immolation, but one of the men's defense lawyers, Hikmat al-Rawashdeh, said the stiff sentences had been influenced by it.
He said growing numbers had been brought before the military courts since ISIS killed the Jordanian pilot, whose jet-fighter crashed in its territory in December.
Officials dispute allegations of injustice. They say many of those on trial had admitted to having fought in Syria. The men said they had returned to Jordan repelled by so many executions and so much devastation. But the government fears they could be part of sleeper cells planning terrorist operations.
Therein lies the dilemma facing Jordan.
Its army and hyper-vigilant security services are widely seen as able to repulse any effort by IS - an offshoot of al-Qaida - to expand its territory in Iraq and Syria into the desert kingdom.
Their problem is dealing with jihadi sympathisers already inside Jordan, beset on its western flank by the festering conflict between Israel and the Palestinians, and to its north and east by the eruption of IS and its call to regional jihad.
Jordan's East Bank tribes are the bedrock of support for King Abdullah and his Hashemite monarchy, and the backbone of his army. But they are now a minority in a small population that absorbed waves of Palestinian refugees from the Arab-Israeli wars of 1948 and 1967, hundreds of thousands from Iraq after the 2003 US-led invasion, and 1.5 million Syrians fleeing civil war.
It is inside impoverished tribal and working class Jordanian and Palestinian-inhabited cities, such as Maan and Zarqa, furthermore, that homegrown jihadis are most often to be found.
The king and his security services are therefore taking no chances.
Government spokesman Mohammed al-Momani said it was to defend national security that after the murder of Kasaesbeh and the air strikes Jordan launched in reprisal on IS targets, 90 local jihadis were hunted down and arrested.
He said that Daesh - the Arabic acronym for the Islamic State of Iraq and the Levant - "is an imminent threat for us and the region. If we leave Daesh to grow, it will expand to our border - this is a cancer that must be taken out."
"We will not wait until the fire spreads to our house."
Before the Kasaesbeh killing, there had been simmering discontent at Jordan's role in the US-assembled coalition against IS. There was also criticism of the decision by King Abdullah and Queen Rania to join a mass solidarity rally in Paris after the Charlie Hebdo and kosher supermarket killings in January, according to Western diplomats and Jordanian analysts.
"Tweets were circulating saying things like: 'If you criticize the Prophet that is freedom of speech, but if you criticize the king that means the State Security court'" said one senior diplomat. "People feel that Jordan is at war but say this is not our war."
But once the graphic video of Kasaesbeh's killing came out, Jordanians, including prominent tribes, closed ranks behind the king. "This has removed for the time being the question of Jordan being part of the coalition, but the underlying issues are still there," the diplomat said.
"These include political and economic reforms, fighting corruption and (alleviating) poverty, as well as the impact of these external crises on Jordan".
Jordan has few resources of its own, chronic energy and water problems, high debt, a dilapidated education system, and a widespread perception of corruption. A debt-strapped government dependent on foreign aid can no longer resolve the problem by padding the state's bulging payroll. The resulting anger and resentment attracts young jobless men to ISIS, often for a combination of ideological and financial reasons.
Diplomats and analysts estimate that between 1,500 and 2,000 Jordanians have fought in Syria, and that there are another 6,000-7,000 jihadi sympathizers inside the country.
"There is an underlying problem with the eastern tribes, which have been the bedrock of Hashemite support", says one diplomat. "The pact has been: 'We will give you our loyalty; you will give us (government) jobs'. But the ability to do that has diminished".
The underlying problems, analysts and politicians say, stem from the failure of the elites to build a cohesive, inclusive modern state, that offers opportunity to its young population.
The gap between areas like the affluent Abdoun district of the capital Amman, meanwhile, with its rich, liberal and Westernised elites, and the dilapidated and teeming squalor of east Amman, where despair and poverty provide fertile ground for ISIS recruiters, has become glaringly wide.
"The failure of governance fed the extremist camp," said a Jordanian politician who declined to be named.
Although the king makes a point to nurture ties to Jordan's tribes, well-off Jordanians also live in a world cut off from religious and conservative segments hostile to their values.
Signs of this split are visible at Jordan's state university, where a sample of students revealed starkly differing views between those studying religion and others.
Sara Majed, 21, a business student, said: "I am for Jordan taking part in the war against Daesh. The video showing the pilot burning was horrific. It was like a Hollywood movie. These people are mentally and psychologically insane. They need treatment in a mental hospital."
Ayat Slaihat, 20, says: "Daesh has no relation to Islam whatsoever. I'm a student of history and I compare Islamic State with other Islamic states that emerged over history. No sultan, Caliph or ruler has ever committed the atrocities that Daeh did - beheadings and burning people alive. These are deviators (khawarej)", a term that harks back to schisms in early Islam.
"THIS IS THE PUNISHMENT"
"We worry about Jordan's stability. We saw what happened in Syria and Iraq and we don't want to see what we built in Jordan over the past years destroyed".
Religious students were ambiguous about the burning of the pilot, attributing the brutality to foreign agents who want to harm Islam's image. They did not wish to give their names.
"Daesh is applying Sharia (Islamic law). The whole world was in uproar (about the burning of the pilot) but this is the punishment (al kasas); it exists in our religion," said a young sharia student who refused to give her name.
"They applied the punishment on him for bombing people by burning him," she added, justifying it on the grounds that the bombs he dropped were burning innocent Muslims.
Another student was convinced the atrocities attributed to Islamic State were the work of the enemies of Islam, namely Israel and the United States.
"All that is being portrayed about Daesh is wrong and aims at disfiguring the image of Islam. There could be an Israeli-American organization behind the bad propaganda against Islamic State to hurt the image of Islam," added one sharia student.
"I wish and long to live in an Islamic State that applies Sharia. Borders don't count; the Islamic State seeks to provide the needs of the people."
According to Abu Mohammad al-Makdisi, an influential Palestinian-born jihadi cleric freed from jail after the pilot's killing, the appeal of IS is growing, especially among young men looking to participate in jihad.
Makdisi, who was seen as a spiritual mentor of al-Qaida, has denounced ISIS publicly for creating its so-called caliphate. His release triggered speculation the intention was to encourage him to speak out against IS. He has been in and out of jail in recent months for opposing Jordan's involvement in the coalition - but also used as a negotiator with IS.
"THERE IS FEAR"
"Most young men here who have a simple mind are followers of Daesh", he said. "Some went to Iraq and others to Syria, some are in contact with the Islamic State from here".
But he said Islamic State followers in Zarqa stopped raising the IS flags and chanting pro-IS slogans after Friday prayers following the crackdown in the wake of the pilot's killing.
"There is fear. But did the burning of the pilot change their mind about the Islamic State group? The answer is no", he said.
"My mission is to spread awareness (of) the mistakes and deviations of Islamic State. Our book (Koran) does not sanctify the killing of aid workers, journalists and non-military people. We want to steer our youth away from the culture of slaughter."
Though critical of ISIS, he says its excesses will not turn him and his followers towards the US and its local allies.
"We are against those Jihadis because they are disfiguring the image of Islam. We are against them not out of betrayal of the Islamic Caliphate or Islamic state that we dream about but because we fear for our Islam".