The US has been forced to water down its plans for an open-ended occupation of Iraq in the face of growing opposition.
Although the US has retreated over some of its proposals – the so-called Status of Forces Agreement – its much heralded deal does not, however, mark the end of the occupation.
In the original proposals the US wanted to establish 400 permanent military installations and launch wars on 'third countries' from Iraqi soil.
This was widely perceived as a threat against Iraq's neighbours and another step towards a war on Iran.
A provision in the treaty that US troops and 'foreign contractors' would be immune from Iraqi law, and that occupation forces would have the right to use deadly force under any conditions, provoked widespread anger.
This forced Iraq's normally compliant government to demand that the US set out a timetable to withdraw its combat troops.
Under Iraqi proposals, US soldiers would withdraw from Iraqi towns and villages by next year and all combat troops would leave by the end of 2011, although this will not cover the status of permanent military bases.
This new draft agreement is a clear setback for US plans for Iraq. The Iraqi rebellion has humbled the US and forced it into a series of compromises that deepened its problems, first with the Shia religious establishment, then with Sunni insurgents, and then with the rebel cleric Moqtada al-Sadr.
The US had attempted to overcome its setbacks by forcing its secret treaty on the Iraqi government. This deal would not have needed the approval of the Iraqi parliament.
But the document was leaked to an Arab newspaper, triggering huge anger.
Iraqis took to the streets in protest, while allies of Iraqi prime minister Nouri al-Maliki threatened to abandon him.
When US secretary of state Condoleezza Rice visited Baghdad earlier this month to push through the deal she was greeted by tens of thousands of demonstrators in the Shia holy city of Najaf – the power base of Ayatollah Ali Sistani, a key supporter of the government. She left empty-handed.
Maliki was forced to tell the US that there would be no agreement unless it dropped demands for immunity and set a timetable for troop withdrawal.
The US insist that the withdrawal is dependent on the 'situation on the ground' – meaning that it could rip up the pledge.
Although the details remain secret, the US is pushing ahead with plans to build permanent military bases and control border posts with Iran.