Iraqi and U.S. negotiators have completed a draft security agreement that would see American troops leave Iraqi cities as early as June 30, Iraqi and American officials told The Associated Press on Wednesday.

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

Also completed is a companion draft document, known as a strategic framework agreement, spelling out in broad terms the political, security and economic relationships between Iraq and the United States, the senior military official said. The official discussed the draft accords on condition that he not be identified by name because the deals have not been announced and are not final.

Besides 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 leave 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 positioned to help Iraqi forces as needed.

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.

It was not clear Wednesday how that has been settled in the draft security accord, which the two governments are referring to as a memorandum of understanding. The draft agreement must be approved by the Iraqi parliament, which is in recess until early next month.

On Wednesday evening a second senior U.S. official, speaking on condition of anonymity, said the two sides have come up with a draft agreement that addresses the issue of the timing of future U.S. troop withdrawals, but the official would not say whether the two sides had agreed on 2011 for a final pullout. The official suggested there would be a series of timelines set, linked to conditions on the ground, and that the draft worked out by the negotiators required more talks at higher levels of the two governments.

The senior U.S. military official said the draft is consistent with U.S. objectives, which include setting a "time horizon" rather than a firm date for the future withdrawal of American forces.

"The improved security in Iraq allows us to have conversations with the Iraqis about setting goals for more American troops to come home and for the Iraqis to take the lead in more combat missions," White House spokesman Gordon Johndroe said. "Any dates in an agreement will be based on conditions on the ground because we do not want to lose the hard-fought gains of the surge."

The draft agreement addresses issues that are key points of contention in the U.S. presidential election, in particular the future U.S. troop presence in Iraq. The presumed Republican candidate in November's election, Sen. John McCain, is opposed to setting any timeline for withdrawals; his presumptive Democratic opponent, Sen. Barack Obama, says he would bring all combat troops home from Iraq within 16 months.

An Iraqi official who was involved in the protracted negotiations said the latest draft was completed last week and sent to the two governments.

The official said a compromise had been worked out on the contentious issue of whether to provide U.S. troops immunity from prosecution under Iraqi law, but he did not give details. In Washington, the senior military official said the draft agreement reflects the U.S. position that the United States must retain exclusive legal jurisdiction over its troops in Iraq.

While Iraqi negotiators signed off on the draft, another official close to Prime Minister Nouri al-Maliki said the country's political leaders objected to parts of the text, including the immunity provision.

"There are different points of view," he said. "We have given ours. The other side has given theirs."

He would not elaborate and spoke on condition of anonymity because of the sensitivity of the issue.

A third senior Iraqi official said al-Maliki himself had gone through the text personally and made notes with objections to some undisclosed points. He also spoke on condition of anonymity.

The security deal is to govern the status of the more than 140,000-strong U.S. military force after the U.N. Security Council mandate for its mission expires at the end of this year.

The Muslim Shiite-led government has been pressing for some sort of timeline for the departure of U.S. troops, saying that is essential to win legislators' approval.

The decision to refer the agreement to parliament followed demands by the country's most powerful Shiite cleric, Grand Ayatollah Ali al-Sistani, that any formula to keep U.S. troops on Iraqi soil even for a limited period must have broad political support.

Bush long had refused to accept any timetable for bringing U.S. troops home. Last month, however, he and al-Maliki agreed to set a "general time horizon" for ending the U.S. mission.

Bush's shift to a broad timeline was seen as a move to speed agreement on the security pact.

Talks were supposed to have been finished by the end of last month but differences over immunity and other issues dragged out the process.