One morning a few weeks ago I sat in a car talking to Rami, a thick-necked former Republican Guard commando who now procures arms for his fellow Sunni insurgents.

Rami was explaining how the insurgency had changed since the first heady days after the US invasion. "I used to attack the Americans when that was the jihad. Now there is no jihad. Go around and see in Adhamiya [the notorious Sunni insurgent area] - all the commanders are sitting sipping coffee; it's only the young kids that are fighting now, and they are not fighting Americans any more, they are just killing Shia. There are kids carrying two guns each and they roam the streets looking for their prey. They will kill for anything, for a gun, for a car and all can be dressed up as jihad."

Rami was no longer involved in fighting, he said, but made a tidy profit selling weapons and ammunition to men in his north Baghdad neighbourhood. Until the last few months, the insurgency got by with weapons and ammunition looted from former Iraqi army depots. But now that Sunnis were besieged in their neighbourhoods and fighting daily clashes with the better-equipped Shia ministry of interior forces, they needed new sources of weapons and money.

He told me that one of his main suppliers had been an interpreter working for the US army in Baghdad. "He had a deal with an American officer. We bought brand new AKs and ammunition from them." He claimed the American officer, whom he had never met but he believed was a captain serving at Baghdad airport, had even helped to divert a truckload of weapons as soon as it was driven over the border from Jordan.

These days Rami gets most of his supplies from the new American-equipped Iraqi army. "We buy ammunition from officers in charge of warehouses, a small box of AK-47 bullets is $450 (£230). If the guy sells a thousand boxes he can become rich and leave the country." But as the security situation deteriorates, Rami finds it increasingly difficult to travel across Baghdad. "Now I have to pay a Shia taxi driver to bring the ammo to me. He gets $50 for each shipment."

The box of 700 bullets that Rami buys for $450 today would have cost between $150 and $175 a year ago. The price of a Kalashnikov has risen from $300 to $400 in the same period. The inflation in arms prices reflects Iraq's plunge toward civil war but, largely unnoticed by the outside world, the Sunni insurgency has also changed. The conflict into which 20,000 more American troops will be catapulted over the next few weeks is very different to the one their comrades experienced even a year ago.

In Baghdad in late October I called a Sunni insurgent I had known for more than a year. He was the mid-level commander of a small cell, active against the Americans in Sunni villages north of Baghdad. Sectarian frontlines had been hardening in the city for months - it took us 45 minutes of haggling to agree on a meeting place which we could both get to safely. We met in a rundown workers' cafe.

Kidnapped

"Its not a good time to be a Sunni in Baghdad," Abu Omar told me in a low voice. He had been on the Americans' wanted list for three years but I had never seen him so anxious; he had trimmed his beard in the close-cropped Shia style and kept looking towards the door. His brother had been kidnapped a few days before, he told me, and he believed he was next on a Shia militia's list. He had fled his home in the north of the city and was staying with relatives in a Sunni stronghold in west Baghdad.

He was more despondent than angry. "We Sunni are to blame," he said. "In my area some ignorant al-Qaida guys have been kidnapping poor Shia farmers, killing them and throwing their bodies in the river. I told them: 'This is not jihad. You can't kill all the Shia! This is wrong! The Shia militias are like rabid dogs - why provoke them?' "

Then he said: "I am trying to talk to the Americans. I want to give them assurances that no one will attack them in our area if they stop the Shia militias from coming."

This man who had spent the last three years fighting the Americans was now willing to talk to them, not because he wanted to make peace but because he saw the Americans as the lesser of two evils. He was wrestling with the same dilemma as many Sunni insurgent leaders, beginning to doubt the wisdom of their alliance with al-Qaida extremists.

Another insurgent commander told me: "At the beginning al-Qaida had the money and the organisation, and we had nothing." But this alliance soon dragged the insurgents and then the whole Sunni community into confrontation with the Shia militias as al-Qaida and other extremists massacred thousands of Shia civilians. Insurgent commanders such as Abu Omar soon found themselves outnumbered and outgunned, fighting organised militias backed by the Shia-dominated security forces.

A week after our conversation, Abu Omar invited me to a meeting with insurgent commanders. I was asked to wait in the reception room of a certain Sunni political party. A taxi driver took me to a house in a Sunni neighbourhood that had recently been abandoned by a Shia family. The driver came in with me - he was also a commander.

The house had been abandoned in a hurry, cardboard boxes were stacked by the door, some of the furniture was covered with white cloths and a few cheap paintings were piled against a wall. The property had been expropriated by the local Sunni mujahideen and we sat on sofas in a dusty reception room.

Abu Omar had been meeting commanders of groups with names like the Fury Brigade, the Battalions of the 1920 Revolution, the Islamic Army and the Mujahideen Army, to discuss options they had for fighting both an insurgency against the Americans and an escalating civil war with the Shia.

Abu Omar had proposed encouraging young Sunni men to enlist in the army and the police to redress the sectarian balance. He suggested giving the Americans a ceasefire, in an attempt to stop ministry of interior commandos' raids on his area. Al-Qaida had said no to all these measures; now he wanted other Iraqi insurgent commanders to support him.

'Do politics'

A heated discussion was raging. One of the men, with a very thin moustache, a huge belly and a red kuffiya wrapped around his shoulder, held a copy of the Qur'an in one hand and a mobile phone in the other. I asked him what his objectives were. "We are fighting to liberate our country from the occupations of the Americans and their Iranian-Shia stooges."

"My brother, I disagree," said Abu Omar. "Look, the Americans are trying to talk to us Sunnis and we need to show them that we can do politics. We need to use the Americans to fight the Shia."

He looked nervously at them: suggestions of talking to the Americans could easily have him labelled as traitor. "Where is the jihad and the mujahideen?" he continued. "Baghdad has become a Shia town. Our brothers are being slaughtered every day! Where are these al-Qaida heroes? One neighbourhood after another will be lost if we don't work on a strategy."

The taxi driver commander, who sat cross-legged on a sofa, joined in: "If the Americans leave we will be slaughtered." A big-bellied man waved his hands dismissively: "We will massacre the Shia and show them who are the Sunnis! They couldn't have done anything without the Americans' support."

When the meeting was over the taxi driver went out to check the road, then the rest followed. "Don't look up, we could be monitored, Shia spies are everywhere," said the big man. The next day the taxi driver was arrested.

By December Abu Omar's worst fears were being realised. The Sunnis had become squeezed into a corner fighting two sides at the same time. But by then he had disappeared; his body was never found.

Baghdad was now divided: frontlines partitioned neighbourhoods into Shia and Sunni, thousands of families had been forced out of their homes. After each large-scale bomb attack on Shia civilians, scores of mutilated bodies of Sunnis were found in the streets. Patrolling militias and checkpoints meant that men with Sunni names dared not venture far outside their neighbourhoods, while certain Sunni areas came under the complete control of insurgent groups the Shura Council of the Mujahideen and the Islamic Army. The Sunni vigilante self-defence groups took shape as reserve units under the control of these insurgent groups.

Like Abu Omar before him, Abu Aisha, a mid-level Sunni commander, had come to understand that the threat from the Shia was perhaps greater than his need to fight the occupying Americans. Abu Aisha fought in Baghdad's western Sunni suburbs, he was a former NCO in the Iraqi army and followed an extreme form of Islam known as Salafism.

Jamming

Deep lines criss-crossed his narrow forehead and his eyes half closed when he tried to answer a question He seemed to evaluate every answer before he spoke. He claimed involvement in dozens of attacks on US and Iraqi troops, mostly IEDs (bombs) but also ambushes and execution of alleged Shia spies. "We have stopped using remote controls to detonate IEDs," he volunteered halfway through our conversation. "Only wires work now because the Americans are jamming the signals."

On his mobile phone he proudly showed me grainy images of dead bodies lying in the street, their hands tied behind their backs . He claimed they were Shia agents and that he had killed them. "There is a new jihad now," he said, echoing Abu Omar's warning. "The jihad now is against the Shia, not the Americans."

In Ramadi there was still jihad against the Americans because there were no Shia to fight, but in Baghdad his group only attacked the Americans if they were with Shia army forces or were coming to arrest someone.

"We have been deceived by the jihadi Arabs," he admitted, in reference to al-Qaida and foreign fighters. "They had an international agenda and we implemented it. But now all the leadership of the jihad in Iraq are Iraqis."

Abu Aisha went on to describe how the Sunnis were reorganising. After Sunni families had been expelled from mixed areas throughout Baghdad, his area in the western suburbs was prepared to defend itself against any militia attack.

"Ameriya, Jihad, Ghazaliyah," he listed, "all these areas are becoming part of the new Islamic state of Iraq, each with an emir in charge." Increasingly the Iraqi insurgency is moving away from its cellular structure and becoming organised according to neighbourhood. Local defence committees have intertwined into the insurgent movement.

"Each group is in charge of a specific street," Abu Aisha said. "We have defence lines, trenches and booby traps. When the Americans arrive we let them go through, but if they show up with Iraqi troops, then it's a fight."

A few days later Rami was telling me about the Sunni insurgents in his north Baghdad area. A network of barricades and small berms blocked the streets around the car in which we sat talking. A convoy of two cars with four men inside whizzed past. "Ah, they are brothers on a mission," Rami said.

Like every man of fighting age, Rami was required to take part in his local vigilante group, guarding the neighbourhood at night or conducting raids or mortar attacks on neighbouring Shia areas.

But he paid $30 a week to a local commander and was exempted.

According to Rami and other commanders, funding for the insurgents comes from three sources. Each family in the street pays a levy, around $8, to the local group. "And when they go through lots of ammunition because of clashes," Rami said, "they pay an extra $5." Then there are donations from rich Sunni businessmen, financiers and wealthier insurgent groups. A third source of funding was "ghaniama", loot which is rapidly becoming the main fuel of the sectarian war

'A business'

"Every time they arrest a Shia, we take their car, we sell it and use the money to fund the fighters, and jihad," said Abu Aisha. The mosque sheik or the local commander collects the money and it is distributed among the fighters; some get fixed salaries, others are paid by "operations", and the money left is used for ammunition.

"It has become a business, they give you money to kill Shia, we take their houses and sell their cars," said Rami. "The Shia are doing the same.

"Last week on the main highway in our area, they killed a Shia army officer. He had a brand new Toyota sedan. The idiots burned the car. I offered them $40,000 for it, they said no. Imagine how many jihads they could have done with 40k."

· Names have been changed in this report.