Ali al-Dabbagh, an Iraqi government spokesman, said: "The withdrawal is to be achieved in three years.

"In 2011, the government at that time will determine whether it needs a new pact or not, and what type of pact will depend on the challenges it faces."

Iraqi law

Concerning the immunity os US personnel from prosecution, al-Dabbagh said: "Inside their bases, they will be under American law.

"Iraqi judicial law will be implemented in case [where] these forces commit a serious and deliberate felony outside their military bases and when off duty."

Under the draft the US does have the right to primary prosecution of troops and contractors who are undertaking military missions.

The Iraqi parliament and cabinet must pass the draft before the end of this year, when the current UN mandate expires.

Intense debate

The pact deciding how long troops would be allowed to stay in Iraq had been debated for months, with the right to prosecute emerging as the main sticking point.

The US had demanded exclusive jurisdiction over prosecution, but Baghdad said this undermined Iraq's sovereignty.

A deal is needed in order for the US military to have a legal basis to remain in Iraq.

The US currently has 147,000 troops in Iraq who rarely leave their bases unless on an authorised mission.

Yet, incidents have occurred of US troops committing crimes, including the rape and murder of a 14-year-old girl, and the murder of her  family, in south Baghdad in 2006.

Four US soldiers pleaded guilty to the crimes in military courts.