Abu Bakr al-Baghdadi declares himself leader of a new caliphate in asermon in the Grand Mosque in Mosul and says the victories of his forces are a sign of divine guidance. He praises jihad, or holy war, and recalls that the Prophet Mohamed used to pray in the front line of his battles.

It is a powerful message that is resonating in the minds of militants across the Islamic world, denying as it does the legitimacy of the political and religious leaders of 1.6 billion Muslims. “I do not promise you, as the kings and rulers promise their followers and congregation, luxury, security and relaxation,” he said. “Instead I promise you what Allah promised his faithful followers.”

The military crisis in Iraq is running in parallel with a political crisis in Baghdad where representatives of Iraq’s three main communities – Shia, Sunni and Kurds – are seeking to choose a new leadership to oppose al-Baghdadi and the Islamic State of Iraq and the Levant (Isis), which last month drove the Iraqi army out of the country’s Sunni provinces.

They are not doing well: the new parliament elected on 30 April decided on Monday to delay its next meeting to select a president, prime minister and speaker until 12 August. In the meantime, Prime Minister Nouri al-Maliki, widely blamed for first provoking and then failing to fight the Sunni rebellion, remains at his post. His strategy is usually to play for time in the expectation that his rivals will fall out and be unable to find a replacement for him.

The way in which Mr Maliki has clung onto power despite defeat is weakening and demoralising the army, government apparatus and the public in Baghdad. In three weeks in the Iraqi capital I did not hear a single person say a good word about him or deny that his blunders have led to disasters.

“Die for al-Maliki, never!” declared a soldier explaining why he would desert rather than go to the front line north of Baghdad.

Isis may not wait for parliament to meet before renewing its offensive. In everything al-Baghdadi has said and done since he became leader of al-Qa’ida in Iraq in 2010 there is a will to put everything to the test of war.

A bigoted and brutal version of Sharia law is being imposed in Raqqa, his Syrian capital, and in Mosul, but for Isis the over-riding justification for their actions is spectacular success on the battlefield.

While the Iraqi parliament dithers and delays, the fighting is getting very close to Baghdad. A divisional commander, Major General Nejm Abdullah Ali, was killed by a mortar bomb 10 miles north-west of Baghdad on Monday. Commander of the army’s Sixth Division, he “met martyrdom on the battlefield as he was fighting… terrorists”, said a statement from the prime minister’s office.

Al-Baghdadi and Isis are consolidating their power and imposing an ever stricter Islamic code. In his Syrian capital Raqqa on the Euphrates, the electricity is cut during the 13-hour-a-day Ramadan fast so people cannot watch television or go on the internet during the time when they should be praying. A fatwa has been issued by the local Sharia committee declaring a total black-out during daylight hours.

A boy inspects the damage after an alleged air raid by Iraqi regime forces in Mosul (EPA)Samer, a local resident, told the online magazine al-Monitor that Isis militants justified the ban by saying: “You are not better than the Prophet and his companions who were living without electricity or any entertainment to alleviate heat and make them forget their thirst.”

Other restrictions imposed by Isis in Raqqa include a ban on tobacco, alcohol, and women going out uncovered or without a chaperone. Local people fear that without air conditioning, because of the power cuts, old people will die because of the heat.

Life is getting harder in Mosul, which was captured in June. There is a fuel shortage with people queuing two days for 20 litres of gasoline. Isis is operating what it says is a “spoils of war” code under Sharia law by which fighters take the houses and assets of opponents who have fled.

Food being distributed by charities on the first day of Ramadan, at encampments for Iraqis who have fled from Mosul (AP)In the Shia Turkoman city of Tal Afar, west of Mosul, from which much of the population has gone, Isis fighters have taken over some 4,000 houses to live in. Although Christians in Mosul were promised tolerance, they have been banned from working in service departments.

Persecution of the Shia as apostates is central to al-Baghdadi’s ideology and at least 10 Shia buildings have been blown up in Mosul. Anti-Shiaism occupies the same position in al-Baghdadi’s beliefs as anti-Semitism did in that of European fascist movements in the 1920s and 1930s. There are signs that Isis is becoming increasingly unpopular among the people it now rules but it is not planning to run for election and its fanaticism makes it difficult to dislodge.