The anti-American Shia cleric Muqtada al-Sadr is the great survivor of Iraqi politics. In a tactical retreat he yesterday authorised a ceasefire under which the Iraqi army, but not US troops, will enter the great Shia slum of Sadr City in Baghdad while Mr Sadr's Mehdi Army militia will stop firing rockets and mortars into the fortified Green Zone.

The ceasefire agreement is intended to end seven weeks of fighting in which more than 1,000 people, mostly civilians, have been killed during US-backed Iraqi government offensives against Mehdi Army strongholds in Basra and Baghdad. The Iraqi Prime Minister, Nouri al-Maliki, has emerged strengthened by his confrontation with the Mehdi Army, but the Sadrists survive to fight another day. "We have agreed on a ceasefire and to end displaying arms in public," said Salah al-Obeidi, spokesman for Mr Sadr. "But we did not agree to disbanding the Mehdi Army or handing over its weapons."

Mr Maliki launched an ill-co-ordinated attack on the Mehdi Army in Basra on 25 March that made no headway until supported by US firepower. Mr Sadr ordered his militiamen off the streets after a week's fighting to avoid an all out confrontation with his US-backed Shia rivals.

The Iraqi government is increasingly confident that it has the upper-hand over its enemies in both the Shia and Sunni communities. It launched a further operation, called "the Roar of the Lion", against al-Qa'ida in the northern city of Mosul on Saturday, deploying 15,000 troops to seal off the city, and yesterday banned all vehicles from the streets.

The feared "Scorpion Brigade" of Interior Ministry troops raided 79 houses, though most were empty. Mosul, a city of 1.4 million, the majority Sunni Arabs, is at the centre of a network of roads which make it easy to take refuge in Syria or escape to other parts of Iraq. "It will be difficult [to eliminate the insurgents] unless the Syrians ...control the border," said the Kurdish leader Saadi Pire.

The Iraqi army operations in Mosul are supported by US helicopters. American forces played a central role in the fighting in Sadr City and Basra. The US will be pleased by the greater effectiveness of the Iraqi government and army. Eighteen months ago, Washington was considering getting rid of Mr Maliki because he was seen as ineffectual. But it will also be alarmed by the increasing role of Iran in arranging the latest ceasefire in Baghdad yesterday and an earlier ceasefire which ended the fighting in Basra.

Ali al-Adee, a member of the ruling Shia alliance of Mr Maliki who went as part of a delegation to Iran seeking an agreement with the Sadrists, said: "The Iranians gave a positive response to the demands made by the delegation. They gave those demands to the Sadrist decision-makers because they have influence on them."

Mr Sadr is the one Shia leader who has opposed the US occupation since the overthrow of Saddam Hussein and has, in return, been detested by American military commanders, politicians and diplomats. But Lt Gen Ricardo Sanchez, the US commander in Iraq in 2003-4, says in his recently published memoirs Wiser in Battle that President George Bush personally ordered Mr Sadr to be captured or killed.

Mr Bush gave the order during a video conference on 7 April 2004 just after the US envoy Paul Bremer had started a crackdown on the Sadrists and they had responded with an uprising during which they had taken over much of southern Iraq.

In General Sanchez's account, Mr Bush said: "The Mehdi Army is a hostile force. We can't allow one man [Sadr] to change the course of the country. At the end of this campaign Sadr must be gone. At a minimum he will be arrested. It is essential he be wiped out."

In an extraordinary outburst, recorded by General Sanchez, Mr Bush said: "Stay strong! Stay the course! Kill them! Prevail! We are going to wipe them out! We are not blinking!"