BAGHDAD — Iraq and the U.S. have reached preliminary agreement to withdraw American forces from Iraqi cities by next June, six years into the increasingly unpopular war, Iraqi Foreign Minister Hoshyar Zebari said Thursday after meeting with Secretary of State Condoleezza Rice.

The negotiations over a withdrawal timetable follow long insistence by President Bush that setting any schedule for U.S. troops to leave would be dangerous. The draft agreement with Iraq would link troop reductions to achievement of certain security milestones, although the details have not been made public.

Time has become ever more important in discussions between U.S. and Iraqi officials with Bush heading into its final months and the presidential candidates tussling daily over how and when they would move to end the war.

Democrat Barack Obama has said he would begin pulling troops out immediately upon taking office and have all combat forces out within 16 months. Republican John McCain has said the situation in Iraq will dictate any pullout schedule, not a timetable set up without consideration of how the war is going.

Rice and Zebari, appearing together at a news conference, asserted that the proposed deal reflects growing confidence in the ability of Iraqi forces to secure the country. A final agreement would require endorsement of the proposed deal by top Iraqi leaders and the Iraqi parliament.

Zebari said the draft would be presented to top leaders, including Prime Minister Nouri al-Maliki. Some members of al-Maliki's Cabinet are known to oppose some aspects.

"What we have accomplished in this agreement is the most advanced version of any" such deal between the United States and other countries where U.S. forces are based, Zebari told reporters, "because the U.S. negotiators indeed showed a great deal of flexibility and understanding."

Rice spoke optimistically of completing a deal but stressed that it still needs top-level Iraqi approval.

"We think it's a good agreement," she said. "We recognize that the government still has to review this agreement ... and we'll await that process, and then it obviously has to go to the Council of Representatives." She was referring to the Iraqi parliament; the Bush administration does not plan to submit the deal to Congress for approval.

The Iraqis have demanded specific timelines for the departure of American forces, and initially the Bush administration resisted.

"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 the prime minister. The two sides had come together on a draft agreement earlier this week and Rice made an unannounced visit to Baghdad to press officials there to endorse it.

Zebari, asked about fears expressed by neighboring countries over such a pact, said in Arabic: "This decision (agreement) is a sovereign one and Iran and other neighboring countries have the right to ask for clarifications. ... There are clear articles (that) say that Iraq will not be used as a launching pad for any aggressive acts against neighboring countries and we already did clarify this."

A key part of the U.S.-Iraqi draft agreement envisions the withdrawal of American forces from Iraq's cities by next June 30, according to Iraqi and American officials who spoke on condition of anonymity because the proposed deal's details have not been publicly announced. A related issue is setting additional timelines for troop withdrawals, including a date by which all U.S. forces would be gone.

Said Zebari: "This agreement determines the principle provisions, requirements, to regulate the temporary presence and the time horizon, the mission of the U.S. forces."

U.S. military forces went into in Iraq in early 2003 and overthrew President Saddam Hussein and the war is now in its sixth year. There have been more than 4,100 U.S. deaths there and countless losses among Iraqis. The war looms as a key issue in the campaign in the United States to elect a successor to Bush, with McCain accusing Obama of advocating too precipitate a withdrawal of U.S. forces from the country.

"We're not sitting here talking about an agreement to try to get out of a bad situation," Rice said, asserting that the draft "builds on the success we have had in the last year. This agreement is based on success."

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.

Associated Press reporter Robert Burns from Washington and Robert Reid from Baghdad contributed to this story.