OSUL, Iraq, Nov. 26 — Since the Americans came to town seven months ago, the firefighters in this northern Iraqi city have gotten new trucks and new uniforms, American training and salaries 10 times larger than they used to be.
But when word came Sunday afternoon that two American soldiers had been shot in the head and killed a block away, the men of Ras al Jada fire station ran to the site and looked on with glee as a crowd of locals dragged the Americans from their car and tore off their watches and jackets and boots.
"I was happy, everyone was happy," Waadallah Muhammad, one of the firefighters, said as he stood in front of the firehouse. "The Americans, yes, they do good things, but only to enhance their reputation. They are occupiers. We want them to leave."
It was not supposed to be this way in Mosul, an ethnically diverse city of two million people and the economic and cultural center of northern Iraq.
As places like Ramadi and Falluja and Tikrit burned and their residents rebelled against the American occupation this summer, Mosul stayed calm, the one city with a Sunni Arab majority where most people still seemed to regard the Americans as their friends. A vigorous and far-reaching effort by the 101st Airborne Division to rebuild the city's roads, schools and public buildings seemed to cement an unusually warm bond.
That appears to be changing very fast. The money the American occupiers once doled out freely has dried up, and other reconstruction aid has yet to arrive. Attacks on Americans, which have killed more than 25 in the Mosul area this month, have highlighted what local Iraqis say is a rapidly deteriorating relationship.
While Iraqi leaders once saluted American soldiers as their partners in building a new country, many now say their complaints go unheard. Moderate Iraqis cooperating with the Americans say the young men of Mosul are increasingly heeding the calls of militant clerics. With three prominent Iraqi civil servants killed in recent weeks, the Iraqis say, they are paying a steadily higher price for their cooperation.
It is not too late, residents say, to rebuild trust, but few Iraqis express much hope. Since the attacks against Americans increased, commanders have sent more troops into the city and detained dozens of suspected militants. The result appears to be a descending spiral, in which the crackdown is draining away much of the good will that remains.
"I want the Americans to succeed, and I want every American soldier to go home safely," said Raad Khairy al-Barhawi, a city councilman and a Sunni Arab. "But the Americans have completely misunderstood the situation. I am trying to help the Americans, and I am getting death threats. I am stuck in the middle."
The situation in Mosul, once so promising, now seems the object of drastically differing perceptions.
American commanders say the situation is still very much in their control, and they insist that they still have the overwhelming support of the people. They say the attacks on their men, while serious, are the work of perhaps a few hundred malcontents, most of them members of Saddam Hussein's old government.
"I reject the idea that things have gone bad here," said Col. Joe Anderson, who commands about 5,000 men in the heart of the city. "Most of the Iraqis are glad we are here, and they are cooperating with us."
Indeed, the progress in Mosul, even with the recent spate of attacks, still strikes a visitor from Baghdad as remarkable. The sidewalks are jammed with shoppers. The telephone, electricity and water networks are in good working order, thanks in large part to $33 million in projects carried out by American soldiers since April. A 28-member city council brings together the city's remarkable mix of Arabs, Christians, Kurds, Shabaks and Yazidhis.
The current attacks in and around Mosul, which number from 6 to 10 a day, are the work of a small number of bitter-enders, the Americans said. Colonel Anderson said the Americans had identified three cells here of about 100 fighters each, a small number given the city's size. Other officers said many of the attacks had been staged by Iraqis who had come from Baghdad and other parts of the so-called Sunni triangle, the region north and west of the capital that is generating most of the violence.
In assaults last week, American troops zeroed in on what they described as a "rat line" of houses and sympathizers stretching south toward Baghdad, a line that assisted militants in traveling north to Mosul. The Americans detained 89 suspected guerrillas in those raids, and more than 100 in others across the city. Among those recently seized, they say, are three members of Al Qaeda and two of another militant Islamic group, Ansar al-Islam.
"What I think is that this is a case of people coming from the outside trying to spoil a good thing," Maj. Trey Cate said.
But many local Iraqis say the Americans' problems run deeper and broader. Expectations that the Americans would rapidly generate prosperity in Mosul have been met with disappointment, and vast numbers of Iraqis still find themselves unemployed. The pool of money the American military used here to employ hundreds of Iraqis for local projects has dried up, and the large sums recently approved by Congress for reconstruction have yet to arrive.
A network of former members of Mr. Hussein's Baath Party, stretching from the universities to government offices, openly flout the Americans' edicts and, some Iraqis say, quietly support the resistance.
"I would say that the number of people who are opposed to the Americans here numbers in the thousands, the tens of thousands," said Hunien Kadu, a professor of economics at Mosul University and a city council member. "There are deans and assistant deans who were high-ranking members of the Baath Party. There are Baathists all through the government. The Americans can't continue to let these people operate."
Many Iraqis complained that the recent American crackdown had pushed potential supporters away. Mr. Barhawi, for instance, cited a local cleric detained on suspicion of encouraging attacks against the Americans in his weekly sermons. He said American troops had handcuffed, hooded and slapped the cleric. Word of that, he said, was helping to alienate many Iraqis here who were still more or less receptive to the American enterprise.
The cleric, Abdul Satar al-Jawiri, was released after a search of his home turned up nothing, Mr. Barhawi said. A spokesman for the 101st Airborne said Wednesday that he could not confirm the incident.
"I am not defending the cleric, but he was humiliated in public," Mr. Barhawi said. "Do you realize what he is going to say in his sermons now?"