The Iraqi army and the Islamic State of Iraq and the Levant (Isis) are battling for control of Iraq's largest refinery outside Baiji north of Baghdad, with each side holding part of the complex. But in the town of Baiji itself, a few miles away, which is completely under the control of Isis, residents say they are most frightened by Isis militants going door to door asking about the numbers of married and unmarried women in the house.
"I told them that there were only two women in the house and both were married," said Abu Lahid. "They said that many of their mujahedin [fighters] were unmarried and wanted a wife. They insisted on coming into my house to look at the women's ID cards [which in Iraq show marital status]."
Isis says its men have been ordered not to bother local people if they are Sunni, but in many places they are imposing their puritanical social norms in the towns they have captured. In Mosul people were at first jubilant that Isis had removed the checkpoints that for years had made movement in the city very slow.
Merchants and farmers were ordered to reduce the prices of their goods. But tolerance and moderation on the part of Isis is intermittent and may be temporary. In one case in Mosul a woman was reportedly whipped, along with her husband, because she was only wearing a headscarf rather than the niqqab cloak covering the whole body. In some captured towns fanatical Isis militants start imposing rules about women's clothing, watching TV in coffee shops and cigarette smoking almost before the fighting is ended.
The restraint, or lack of it, shown by Isis has important political implications. When al-Qa'ida in Iraq, the forerunner of Isis, insisted on local women marrying their fighters during the Sunni-Shia civil war between 2004 and 2008, they alienated much of the Sunni community. They killed even minor government employees. "I would rather have my door kicked in by American soldiers than by al?Qa'ida because, with the Americans, I would stand a better chance of staying alive," a young Sunni man in Baghdad said at the time. Such feelings enabled the Americans to create Sahwa, an anti-al-Qa'ida force among the Sunni.
Isis could isolate itself again through its brutality and bigotry, though its leaders show signs of recognising where they went wrong last time. Its fighters act as the shock troops of what has turned into a general Sunni uprising, but it is only one part, albeit the most important, of a loose alliance of seven or eight militant Sunni groups that could easily break apart.
For now, it is held together by a common sense of grievance and hatred against Nouri al-Maliki, the Prime Minister, and his government whom it sees as persecuting and marginalising the Sunni community. The departure of Mr Maliki will remove part of the glue holding together the Isis-led Sunni alliance.
Some strains between the Sunni rebel factions are already evident: When the Naqshabandi Army, of which Saddam Hussein's former deputy Izzat al-Douri is titular head, put up posters of Saddam in Mosul, Isis gave them 24 hours to take them down or face the consequences. The Naqshabandi Army did not want a confrontation and complied.
Government television channels try to push the idea that the Sunni coalition is already in disarray, but this is probably premature. In most Sunni towns captured by the insurgents, people say they are more frightened by the return of vengeful government forces than they are by the presence of Isis.
For the moment, the battle lines have steadied north of Baghdad after the blitzkrieg advance of Isis and its allies. The fighting for Baiji refinery has been swaying backwards and forwards for the past five days. Further south, Isis holds Tikrit, though a resident said "many people are fleeing to Erbil and Sulaimaniyah in Kurdistan because they think that if the Iraqi Army returns, it will shoot everybody indiscriminately". In Sunni areas Isis is still mopping up resistance: yesterday its fighters captured al-Qaim close to the border with Syria after a fight in which 30 government soldiers were killed.
One aspect of Isis's success receives too little attention. Its prestige has been enhanced across the Sunni world, especially among young Sunni men in bordering countries.
For a decade television in Sunni states has dwelt on the oppression of the Iraqi Sunni and it is undeniable that it was Isis forces that broke Baghdad's dominance over its Sunni minority. Isis successes may already be having an impact in Syria, where its fighters have overrun the headquarters of the Western-backed Free Syrian Army in Deir Ezzor province in the north-east of the country.
In the mainly Shia city of Baghdad, there is terror of Isis breaking through and conducting a general massacre. It is noticeable that Isis has not activated its cells in Sunni enclaves and there have, by Baghdad standards, been few bombs. It may be that Isis is over-stretched, but it could be waiting for its fighters advancing from the north to get closer to the capital before activating its cells inside the city.
Sunni and Shia in the capital are both worried for a further reason. The government has handed over security in many parts of Baghdad to militiamen who have been setting up their own checkpoints. Some belong to Asa'ib Ahl al-Haq, a splinter group from the Shia cleric Muqtada al-Sadr's movements, who are well-armed and wear black. There are other militias such as Ketaeb Hezbollah, no relation to the Lebanese movement of that name, who wear a green uniform like the army. Both these militias carry more authority than regular soldiers and the police, many of the latter melting away and staying at home.
Baghdadis consider these militias as semi-criminal groups quite capable of kidnapping likely targets for ransom at their checkpoints. Asa'ib Ahl al-Haq is seen as being under the influence of Mr Maliki and the Iranians but its men act generally in their own interests.
The strength of the militias was on display yesterday in Sadr City, the stronghold of the movement led by Mr Sadr. Twenty thousand armed men were paraded with heavy weapons such as machine guns, multiple rocket launchers and missiles as well as assault rifles. Mr Sadr has pledged that these militia will only act in defence of the Shia shrines in Samarra, Baghdad, Karbala and Najaf, but the state's inability to defend these holy sites illustrates how far its authority has withered in the past two weeks.
The military situation remains fluid. "My bet is that the government will not be able to retake Mosul, but Isis will not be able to keep it long-term," said an Iraqi political analyst who did not want to be named. He argued that Mosul was a traditional and nationalist city and not a particularly religious one, so Isis will ultimately be evicted by its people.
That may be so, but Isis has proved by its ferocity that it is difficult to dislodge once in power. In its Syrian capital at Raqqa on the Euphrates it publicly crucified young men who had started an armed resistance movement to oppose it.