SAN'A, Yemen -- When the Yemeni authorities released a convicted al-Qaida terrorist named Jamal al-Badawi from prison in October, U.S. officials were furious. Badawi helped plan the attack on the USS Cole in 2000, in which 17 American sailors were killed.
But the Yemenis saw things differently. Badawi had agreed to help track down five other members of al-Qaida who had escaped from prison and was more useful to the government on the street than off, said a high-level Yemeni government official, who spoke on condition of anonymity. He had also pledged his loyalty to Yemen's president before being released, the official said.
The fracas over Badawi - whom the Yemenis quickly returned to prison after being threatened with a loss of aid - underscored a much broader disagreement over how to fight terrorism in Yemen, a particularly valuable recruiting ground and refuge for Islamist militants in the past two decades.
Yemeni officials say they have had considerable success co-opting jihadists such as Badawi, often by releasing them from prison and helping them with money, schooling or jobs. They are required to sign a pledge not to carry out any attacks on Yemeni soil, often backed by guarantees from their tribe or family. Many have taken part in an Islamic re-education effort led by religious scholars, now being copied on a wider scale in Saudi Arabia.
A number of these former jihadists have become government informers, helping to capture a new generation of younger, more dangerous al-Qaida militants - some of them veterans of the war in Iraq. Others have become mediators, helping persuade escaped prisoners to surrender themselves.
But U.S. counterterrorism officials and even some Yemenis say Yemen's government, more than others in the region, is in effect striking a deal that helps stop attacks here while leaving jihadists largely free to plan them elsewhere.
"Yemen is like a bus station - we stop some terrorists, and we send others on to fight elsewhere," said Murad Abdul Wahed Zafir, a political analyst at the National Democratic Institute in San'a. "We appease our partners in the West, but we are not really helping."
The Yemeni government argues that its approach is in keeping with Yemen's deeply conservative society, where Osama bin Laden and Saddam Hussein remain popular figures. Although a new U.S.-trained commando unit has regularly captured and killed hard-core terrorists, officials say they must also show restraint with prisoners: taking a harder line or acceding to U.S. demands to extradite people such as Badawi could provoke a violent backlash.
"The strategy is fighting terrorism, but we need space to use our own tactics, and our friends must understand us," said Rashad Muhammad al-Alimi, Yemen's interior minister.
After the attacks of Sept. 11, 2001, President Ali Abdullah Saleh flew to Washington and pledged full cooperation with U.S. anti-terrorism efforts. At home in Yemen, thousands of former "Afghan Arabs" were rounded up and imprisoned.
But Saleh was still sensitive to Islamic extremists, who remained a crucial domestic constituency. When the Pentagon leaked word of Yemeni collaboration in a U.S. missile strike in 2002 that killed the suspected leader of al-Qaida in Yemen, Saleh was furious.
That same year, Saleh hit on an idea that he hoped would satisfy both his U.S. and Islamist partners: al hiwar al fikri, or intellectual dialogue. This was an effort to inculcate the idea that Islam, properly understood, does not condone terrorism.
"It came from the idea that terror depends on ideology, and that thought should be confronted with thought," said Hamoud al Hetar, the cleric and judge who led the program.
Some critics have dismissed the dialogue program, which lapsed in 2005 after terror attacks dropped off, as a sham in which inmates feigned conversion to get out of prison. But Nasser al-Bahri, a former driver for Osama bin Laden, said it was more like a raw bargain: exempt Yemen from your jihad and you will be left alone.
"It changed their behavior, not their thoughts," said al-Bahri, 33, - who once went by the nom de guerre Abu Jandal. "Judge Hetar cannot cancel jihad, it is in the roots of our religion."
Al-Bahri said he has tried to reason with members of the younger generation of militants, but they refuse all dialogue. He now carries a weapon at all times, fearing for his safety, he said.
Asked what he did to advance the cause of al-Qaida outside of Yemen, al-Bahri smiled and said answering the question could be dangerous - but that not answering it could also expose him to risks, from a different group of people. After a pause, he said he merely prayed for al-Qaida's success.