QABR ABED, Iraq - These days, this town in northern Iraq is relatively safe compared with other Sunni Arab-dominated areas of Iraq. For a village that long held folk status among Iraqis as one of the most sinister places in the country, that is quite a change.
As the insurgency gathered strength last year, Qabr Abed served as a weapons depot and safe haven for an unusually large number of home-grown insurgent commanders, including Mohammed Shakara, Al Qaeda's leader for northern Iraq and its biggest city, Mosul.
"It was for the insurgency what the Dominican Republic is to baseball," said Capt. Kevin Burke, who commands Company C of the First Battalion of the Fifth Infantry Regiment, which oversees Qabr Abed.
Now, however, the village has a homegrown police force that maintains checkpoints and conducts patrols - a rarity in rural Sunni Arab areas, where the police often hunker down in their barracks or, worse, conspire with insurgents.
No American soldiers have been killed or wounded here in five months. And members of Mr. Shakara's own family fed information to American forces that aided in his capture in June, according to American commanders in Mosul.
If Qabr Abed can maintain its relative calm, which American officers here say will require constant handholding, it will stand as a striking contrast to other Sunni Arab regions in the rest of Iraq where the insurgency remains undiminished. Just 15 miles north, in Mosul, insurgents routinely kill policemen and attack soldiers and civilians with mortars and car bombs. And in Tal Afar, 40 miles to the west, residents say insurgents effectively control many neighborhoods. [On Saturday, a suicide bomber posing as a police officer killed 6 Iraqi policemen and wounded 10 others in Hammam al Alil, a town near Qabr Abed.]
Early in the occupation of Iraq the Bush administration pursued a strategy - a misguided one, in the view of many military commanders in Sunni Arab areas - of marginalizing Sunni leaders suspected of ties to insurgents or the Baath Party of Saddam Hussein.
Now, however, the administration, tacitly acknowledging that military power may never defeat the Sunni-dominated insurgency, has swung to the other extreme: courting Sunni Arabs with strong ties to insurgents.
That is what some American soldiers, rushed here last November to quell an insurgent uprising, ultimately figured out for themselves. Looking for effective leaders, they turned to a handful of Sunni Arabs, each with ties to the former government or the insurgency, to take control of the police and what remained of a municipal administration. They say they had no choice.
"Everyone here alive today, and who is still effective, was at least compliant with the insurgents," said Captain Burke, 36, of Dupont, Wash. "Otherwise, they would have been killed."
Working with Sunnis who have checkered histories can be messy, the soldiers discovered, with trade-offs that would be unacceptable in a Western country. And Qabr Abed can still be dangerous: in early June insurgents killed a police officer, a cousin of Mr. Shakara, using a car bomb that struck the officer's house just a few doors from the police station.
If the village today seems to stand as one small example of how the insurgency can be contained, commanders caution that signs of progress might prove deceptive, that those who seem to be friends and allies can switch sides overnight.
"You always make sure you keep your back plates in," said Captain Burke, a reference to body armor. "Everybody here has a past."
The 150 men of Company C were rushed to this village of 1,000 tightly packed homes in November after Mr. Shakara blew up the police station with explosives-laden propane canisters. Nearby, Iraqi national guard troops under the sway of insurgent leaders ransacked a base that had just undergone a multimillion-dollar American renovation.
The troops began nonstop day and night patrols, braving frequent roadside bombs to round up scores of suspected insurgents - but earning the hatred of many residents.
Back then, the entire region around Mosul was swept by an insurgent revolt that coincided with the Marines' invasion of Falluja, but was also fostered in part by a sharp drawdown in United States troops in northern Iraq earlier in the year.
In mid-November, almost all the police in Mosul and surrounding towns quit, and over a two-month period insurgents led by Mr. Shakara beheaded or shot more than 200 Iraqis they deemed "collaborators," according to the American military.
Meanwhile, Mr. Shakara was operating with impunity in Qabr Abed. American commanders received reports that foreign fighters killed in Mosul were sometimes buried here and that he attended the funerals.
Soldiers quickly learned that Qabr Abed was also home to many senior officers in the old Iraqi Army, making for an explosive combination of Hussein loyalists and jihadists. The extent of their intimidation was plain in January, when only 800 people in a region of 56,000 voted in national elections.
But as the cold winter wore on, Company C began to score some wins. And as those successes accumulated, the townspeople, the commanders here said, slowly shifted their allegiance to the Americans.
One major turning point, the commanders said, came when a person embittered by Mr. Shakara's murders of some of his family members disclosed the identities of several dozen insurgents, who were quickly rounded up. After that, and the bust-up of a cell of Syrian fighters, the villagers became convinced that the Americans were gaining the upper hand, said Tariq Ahmed Sleman, a police captain. Villagers, fed up with constant raids, began providing information.
"They began to divorce themselves from Shakara," said Captain Sleman, who ultimately won the trust of the American troops. In all, at least 50 insurgents captured in Qabr Abed since November remain in custody, said First Lt. Nik Trotta, 24, of Boise, Idaho, an intelligence officer here.
Another crucial event came on March 7, when a man showed up saying he was the town police chief and could organize dozens of officers.
The Americans were skeptical, but that afternoon they went to the police station - abandoned after the November bombing - and were shocked to find themselves heavily outnumbered by policemen, some of them in uniform. "I thought I had walked into an ambush," Captain Burke recalled.
The chief, Lt. Col. Khaled Hussein Ali, is a former army intelligence officer and onetime smuggler who funneled guns and other weapons to Mr. Shakara and other insurgents in November, said Captain Sleman, who is now Chief Ali's right-hand man.
Captain Sleman himself was once a close friend of Mr. Shakara. They drank beer and chased women together, Captain Sleman said, before what he described as his friend's bizarre midlife embrace of Wahhabism, the ultrafundamentalist strain of Islam.
Captain Sleman, a former army officer who had taken up farming, said Chief Ali approached him this spring with a plan to rebuild the police force and work with the Americans. The chief, interviewed at his home in Qabr Abed, said he threw his lot in with the soldiers after they had captured a large numbers of insurgents. "The American soldiers cleared this area out," he said.
But before agreeing to serve with the chief, Captain Sleman demanded a promise that they do it right - no bribe taking, no relenting. Otherwise, he told the chief, "two weeks from now all of the insurgents are going to be riding you like a donkey."
Both men are risking their lives. Chief Ali, who has dodged periodic assassination attempts by assailants armed with rocket-propelled grenades, now lives with a $25,000 bounty on his head, American officers say. The bounty on Captain Sleman is $10,000. [The bomber on Saturday in Hammam targeted a meeting of regional police leaders that included Chief Ali, who escaped unharmed, American officers said, after a Qabr Abed policeman guarding the meeting blocked the bomber from entering.]
Captain Sleman immediately went to work recruiting. "You only die once," he says he told prospective policemen. The police did not shrink from danger: weeks before Mr. Shakara's capture, several dozen officers appeared on provincial television shouting, "We're going to get you, Shakara!"
In the past three months they have apprehended more than a dozen insurgents and seized a half-dozen hidden stockpiles containing more than 1,000 grenades and mines, matériel that American officers say was used to replenish fighters in Mosul.
To Khalif Khudr Mohammed al-Jabouri, mayor of the district that includes Qabr Abed and Hammam, it was no surprise that the police discovered the weapons. "They were the ones who buried them," he told Lt. Col. Todd McCaffrey, the battalion commander here.
Officers concede that Qabr Abed could easily backslide. "If you let up at all, you open up the opportunity for what happened in November," Lieutenant Trotta said. "It was horrible, dark, tiring and exhausting."
Mayor Jabouri was another critical figure in the town's fight against insurgents. A former intelligence general under Saddam Hussein with close ties to the black-shirted fedayeen militias that served as Mr. Hussein's private army, he was appointed in December by the regional governor.
American officers decided to work with him for two reasons: he got the job done and had the unusual habit of keeping his promises. He has also vocally backed the new Iraqi government and the American military while surviving assassination attempts - an unfortunate barometer of true loyalties in many Sunni Arab areas.
The American soldiers helped empower the mayor by funneling some reconstruction contracts through him, including $400,000 for a jobs program and $200,000 for a new fire station.
"We pump dollars through him as one way to give him leverage," said Maj. Tim Vidra, the battalion's departing civil affairs officer. After the mayor threatened to withhold money for jobs from neighborhoods harboring makers of roadside bombs, the bombings stopped, Major Vidra said.
This approach has complications: American officers suspect that some money was siphoned off. American officers have not confronted the mayor about their suspicions, partly out of fear of muddling a relationship with someone crucial to restoring stability in this area. "This isn't Mayberry," Colonel McCaffrey said. "There are different cultural norms here. It doesn't make it right or wrong; it just makes it reality."
The men of Company C will end their yearlong deployment in September. But the officers say they still do not truly know their Iraqi counterparts. All here seem to have something shady in their past, the officers say, and some never betray their true intentions.
"You always have to tread cautiously," Lieutenant Trotta said, "and you can never mistake their hospitality for loyalty."
Captain Burke said the collapse of the Mosul police in November yielded a hard lesson. "Mosul had 5,000 police officers on Nov. 10, and everybody thought this place was how it was done," he said. "Then all the police quit and the police chief turned out to be dirty. I don't want to fall in love with something, and then be blind to something that I didn't see."