Radicals riot in jails in Jordan and Afghanistan. Al Qaeda convicts break out of a Yemen cell block. In the struggle to contain extremists, holding such prisoners together may lead to more unrest — or turn jails into "schools" where Al Qaeda passes on its violent ideology.

"It is a huge problem. The spread of jihadism has increased significantly as has the number of people being arrested," Rohan Gunaratna, a Singapore-based terrorism expert, said Thursday.

A top Jordanian judicial official said Wednesday's riots at three prisons showed that detained militants were likely using the Internet, mobile phones or visitors to pass messages.

"What happened in the prisons was very dangerous and we have to find out how the detainees coordinated with each other," said Judge Ali al-Dhmour, secretary-general of the Justice Ministry.

Some people ask whether it might be better to hold militants in prisons in the West, or perhaps to devote more effort to rehabilitation.

But Washington has shown a clear interest in having Mideast governments hold such prisoners so those governments can interrogate them — often with little human rights oversight — and pass information to the U.S. government.

Rehabilitation efforts, meanwhile, have been spotty.

Egypt had success in dampening Islamic extremism in a previous generation, and Saudi Arabia claims to have converted some Al Qaeda sympathizers to less radical views. But Yemen's rehabilitation effort is criticized by Western officials who say it just returns dangerous people to the streets.

Experts say a key problem in Jordan is the lumping together inside jails of common criminals and Islamic extremists, including members of the Al Qaeda in Iraq network headed by Jordanian-born terrorist Abu Musab al-Zarqawi.

"These jails are like schools or universities for Islamic extremists, where they influence other prisoners and spread their 'takfiri' views," said Sameeh Khreis, a Jordanian lawyer who represents militants.

The extremist takfiri ideology urges Sunni Muslims to kill anyone they consider an infidel, even fellow Muslims.

Among Khreis' clients is Azmi al-Jayousi, a Jordanian sentenced to death with al-Zarqawi for a 2004 plot to stage chemical attacks on targets inside Jordan, including the U.S. Embassy.

Jordanian officials said Wednesday's riots broke out when prisoners at one jail demanded that al-Jayousi and another Al Qaeda-linked militant, Salem bin Suweid of Libya, be transferred to another prison. Suweid is on death row for fatally shooting U.S. aid worker Laurence Foley in 2002.

Unlike al-Jayousi and Suweid, many suspected militants across the Middle East and North Africa are jailed indefinitely with no charges filed.

"Indefinite detention has a special way of driving people a little crazy and provides a greater incentive to riot," said John Sifton, a counterterrorism expert for the U.S.-based Human Rights Watch.

Jordan's riots came less than a month after 23 Al Qaeda inmates, including one convicted in the 2000 attack on the USS Cole, tunneled out of a high-security jail in Yemen. Yemeni officials said they thwarted escape attempts by al-Qaida suspects at two other prisons this week.

In Afghanistan, a four-day rebellion that left six inmates dead and exposed security flaws at the Central Asian nation's main prison ended Wednesday when more than 1,000 inmates surrendered. Officials said the last to give up were Al Qaeda and Taliban militants.

Al Qaeda and Taliban members have also escaped from high-security prisons in Afghanistan, including a U.S. military facility. Seven Taliban rebels fled a Kabul prison Jan. 22, some six months after four Al Qaeda militants broke out of jail at Bagram, the U.S. military's headquarters north of Kabul.

It was unclear if there was any direct coordination among the various events, but Jordanian political analyst Labib Kamhawi said there "is a (common) sense of injustice and anger on the part of the Islamist prisoners."

Yemen says it is trying to turn detained Islamic extremists away from radicalism and reintegrate them into the community through a reconciliation program.

But Western officials are critical of the effort, saying Yemen may just be trying to discourage attacks at home, rather than truly convert people from extremism. One judge said last year the program doesn't focus on trying to keep Yemenis from going to Iraq, for example.

Yossi Melman, a respected Israeli intelligence writer, thinks it is possible to rehabilitate only a few extremists, leaving governments in "a no-win situation."

"If you release them, they will go back to the arenas of their crimes," Melman said. "But if they stay in jail there are negative ramifications for Western governments and societies, because prisons are their best schools where they strengthen themselves and reaffirm their beliefs."