The United States and Iraq have almost reached a deal on extending the stay of U.S. troops in the country beyond 2008, but any agreement would have to have reasonable timetables for withdrawal, said U.S. Secretary of State Condoleezza Rice Thursday.

Rice and Iraqi Foreign Minister Hoshiyar Zebari appeared together at a news conference Thursday, where they said Washington and Baghdad were close to agreement on a broad document spelling out the nature of any future U.S. troop presence and Washington-Baghdad relations.

"We have agreed that some goals, some aspirational timetables for how that might unfold, are well worth having in such an agreement," Rice told reporters after meeting with Iraqi officials, including Prime Minister Nouri al-Maliki.

The two sides had come together on a potential draft agreement Wednesday that extends the legal basis for U.S. troops to remain in Iraq beyond the end of this year, while calling for them to move out of Iraqi cities as soon as June 30, 2009.

Rice made an unannounced visit to Baghdad Thursday to iron out any remaining differences with Iraqi officials.

U.S. officials say more work is needed to reach agreements on a timeline for withdrawals, immunity for U.S. troops and the handling of Iraqi prisoners.

Rice would not give any details of what the specific sticking points in the agreement were.

A senior U.S. military official in Washington said the deal is acceptable to the U.S. side, subject to formal approval by U.S. President George W. Bush. It also requires approval by Iraqi leaders, and some members of Iraq's cabinet oppose some of its provisions.

Iraqi opposition

Followers of anti-American Shiite cleric Muqtada al-Sadr criticized Rice's visit and repeated their opposition to the security agreement. Sadr's followers control 30 of the 275 seats in parliament.

"We demand the Iraqi government, and on the highest levels, not to sign this unjust agreement and we demand the withdrawal of the government as soon as possible," said Luai Smeisem, the head of the political bureau in Sadr movement.

In addition to spelling out that U.S. troops would move out of Iraqi cities by next summer, the Iraqi government has pushed for a specific date — most likely the end of 2011 — by which all U.S. forces would depart the country. In the meantime, the U.S. troops would be positioned on bases in other parts of the country to make them less visible while still being able to assist Iraqi forces as needed.

There are now about 140,000 U.S. troops in Iraq.

U.S. officials have resisted committing firmly to a specific date for a final pullout, insisting that it would be wiser to set a target linked to the attainment of certain agreed-upon goals. These goals would reflect not only security improvements but also progress on the political and economic fronts, they have said.

U.S. Republican presidential candidate John McCain, while favouring troop reduction in Iraq, has echoed the Bush administration's unwillingness to commit to a firm timetable for troop pullout.

The Iraqi push for the 2011 deadline resembles U.S. Democratic presidential candidate Barack Obama's plan to pull out troops by mid-2010.

With files from the Associated Press