The executions are carried out at dawn on Haqlania bridge, the entrance to Haditha. A small crowd usually turns up to watch even though the killings are filmed and made available on DVD in the market the same afternoon.

One of last week's victims was a young man in a black tracksuit. Like the others he was left on his belly by the blue iron railings at the bridge's southern end. His severed head rested on his back, facing Baghdad. Children cheered when they heard that the next day's spectacle would be a double bill: two decapitations. A man named Watban and his brother had been found guilty of spying.

With so many alleged American agents dying here Haqlania bridge was renamed Agents' bridge. Then a local wag dubbed it Agents' fridge, evoking a mortuary, and that name has stuck.

A three-day visit by a reporter working for the Guardian last week established what neither the Iraqi government nor the US military has admitted: Haditha, a farming town of 90,000 people by the Euphrates river, is an insurgent citadel.

That Islamist guerrillas were active in the area was no secret but only now has the extent of their control been revealed. They are the sole authority, running the town's security, administration and communications.

A three-hour drive north from Baghdad, under the nose of an American base, it is a miniature Taliban-like state. Insurgents decide who lives and dies, which salaries get paid, what people wear, what they watch and listen to.

Haditha exposes the limitations of the Iraqi state and US power on the day when the political process is supposed to make a great leap - a draft constitution finalised and approved by midnight tonight.

For politicians and diplomats in Baghdad's fortified green zone the constitution is a means to stabilise Iraq and woo Sunni Arabs away from the rebellion. For Haditha, 140 miles north-west of the capital, whether a draft is agreed is irrelevant. Residents already have a set of laws and rules promulgated by insurgents.

Within minutes of driving into town the Guardian was stopped by a group of men and informed about rule number one: announce yourself. The mujahideen, as they are known locally, must know who comes and goes.

The Guardian reporter did not say he worked for a British newspaper. For their own protection interviewees cannot be named.

There is no fighting here because there is no one to challenge the Islamists. The police station and municipal offices were destroyed last year and US marines make only fleeting visits every few months.

Two groups share power. Ansar al-Sunna is a largely homegrown organisation, though its leader in Haditha is said to be foreign. Al-Qaida in Iraq, known locally by its old name Tawhid al-Jihad, is led by the Jordanian-born Abu Musab al-Zarqawi. There was a rumour that Zarqawi, Washington's most wanted militant after Osama bin Laden, visited early last week. True or not, residents wanted to believe they had hosted such a celebrity.

A year ago Haditha was just another sleepy town in western Anbar province, deep in the Sunni triangle and suspicious of the Shia-led government in Baghdad but no insurgent hotbed.

Then, say residents, arrived mostly Shia police with heavyhanded behaviour. "That's how it began," said one man. Attacks against the police escalated until they fled, creating a vacuum filled by insurgents.

Alcohol and music deemed unIslamic were banned, women were told to wear headscarves and relations between the sexes were closely monitored. The mobile phone network was shut down but insurgents retained their walkie-talkies and satellite phones. Right-hand lanes are reserved for their vehicles.

From attacks on US and Iraqi forces it is clear that other Anbar towns, such as Qaim, Rawa, Anna and Ramadi, are to varying degrees under the sway of rebels.

In Haditha hospital staff and teachers are allowed to collect government salaries in Ramadi, the capital of Anbar, but other civil servants have had to quit.

Last year the US trumpeted its rehabilitation of a nearby power plant: "The incredible progress at Haditha is just one example of the huge strides made by the US army corps of engineers."

Now insurgents earn praise from residents for allegedly pressuring managers to supply electricity almost 24 hours a day, a luxury denied the rest of Iraq.

The court caters solely for divorces and marriages. Alleged criminals are punished in the market. The Guardian witnessed a headmaster accused of adultery whipped 190 times with cables. Children laughed as he sobbed and his robe turned crimson.

Two men who robbed a foreign exchange shop were splayed on the ground. Masked men stood on their hands while others broke their arms with rocks. The shopkeeper offered the insurgents a reward but they declined.

DVDs of beheadings on the bridge are distributed free in the souk. Children prefer them to cartoons. "They should not watch such things," said one grandfather, but parents appeared not to object.

One DVD features a young, blond muscular man who had been disembowelled. He was said to have been a member of a six-strong US sniper team ambushed and killed on August 1. Residents said he had been paraded in town before being executed.

The US military denied that, saying six bodies were recovered and that all appeared to have died in combat. Shortly after the ambush three landmines killed 14 marines in a convoy which ventured from their base outside the town.

Twice in recent months marines backed by aircraft and armour swept into Haditha to flush out the rebels. In a pattern repeated across Anbar there were skirmishes, a few suspects killed or detained, and success was declared.

In reality, said residents, the insurgents withdrew for a few days and returned when the Americans left. They have learned from last November's battle in Falluja, when hundreds died fighting the marines and still lost the city.

Now their strategy appears to be to wait out the Americans, calculating they will leave within a few years, and then escalate what some consider the real war against a government led by Shias, a rival sect which Sunni extremists consider apostasy.

The US military declined to respond to questions detailing the extent of insurgent control in the town.

There was evidence of growing cooperation between rebels. A group in Falluja, where the resistance is said to be regrouping, wrote to Haditha requesting background checks on two volunteers from the town.

One local man in his 40s told the Guardian he wanted to be a suicide bomber to atone for sins and secure a place in heaven. "But the mujahideen will not let me. They said I had eight children and it was my duty to look after them."

Tribal elders said they feared but respected insurgents for keeping order and not turning the town into a battleground.

They appear to have been radicalised, and condemned Sunni groups, such as the Iraqi Islamic party and the Muslim Scholars' Association, for engaging in the political process.

The constitution talks, the referendum due in October, the election due in December: all are deemed collaboration punishable by death. The task now is to bleed the Americans and destabilise the government. Some call that nihilism. Haditha calls it the future.

· Omer Mahdi was in Haditha for a Guardian Films project before security precautions forced it to be suspended.