Iraq's parliament has agreed to put a controversial deal allowing US troops to stay in the country for another three years to a public vote.
MPs on Wednesday decided to make the pact dependent on a national referendum - to be held in 2009 - after delaying by 24 hours their vote on the deal.
MPs will now vote on the wide-ranging accord on Thursday after reservations by Sunnis and opposition by Shias threatened to derail the agreement.
The accord has been subject to numerous revisions in an attempt to keep various political factions on board and push it through parliament with a respectable majority.
The pact now makes provision for Iraqi supervision of US forces and also meets demands for a clear exit timetable for the 150,000 US troops in Iraq.
However, the Shia-led government was still struggling to agree concessions demanded by different political blocs in return for lending support for the pact.
Hoshyar Zebari, Iraq's foreign minister, insisted it was still possible to reach an agreement on the deal.
"There are complications, but we haven't lost hope yet," he said.
"We do not want to pass this agreement with a difference of two or three votes. For this reason we are continuing efforts to achieve a vast majority"
Khaled al-Attiya, Iraqi deputy parliamentary speaker
The decision to hold a referendum next year could set Baghdad on a collision course with Washington, which needs the pact to replace the UN mandate governing international forces in Iraq which expires on December 31.
However Condoleezza Rice, the US secretary of state, said that the proposed referendum would not prevent the pact from taking effect on January 1.
"My understanding is that nothing here delays the entering into force of the agreement and that's really the important point," Rice said at a news conference on Wednesday.
The 275-member assembly is expected to vote on Thursday on the pact, which would require US troops to withdraw from Iraqi cities by the end of June and from the rest of the country by the end of 2011.
The measure is broadly supported by the Shia United Iraqi Alliance (UIA), the Kurdish alliance and a number of independent MPs - enough for it to pass with slightly more than the requisite simple majority of 138 votes.
But Khaled al-Attiya, the deputy parliamentary speaker, said the government and the UIA were making a last-minute push to assemble a broader coalition.
"We do not want to pass this agreement with a difference of two, three or four votes," Attiya told the AFP news agency on Tuesday.
The agreement - the product of nearly a year of tough negotiations - was approved by Iraq's cabinet over a week ago with support from the major blocs representing the country's Shia, Sunni and Kurdish communities.
Iraq won a number of concessions in the deal, including a specific timeline for withdrawal, the right to search US military cargo and the right to try US soldiers for crimes committed while they are off their bases and off-duty.
The agreement also requires that US troops obtain Iraqi permission for all military operations, and that they hand over the files of all detainees in US custody to the Iraqi authorities, who will decide their fate.
The pact also forbids US troops from using Iraq as a launch-pad or transit point for attacking another country, which may reassure Syria and Iran.
But the accord has drawn criticism from certain quarters, including followers of Moqtada al-Sadr, the Shia leader.