BAGHDAD — Iraqi and U.S. negotiators have completed a draft security agreement that would see American troops leave Iraqi cities as soon as June 30, Iraqi and American officials said Wednesday.

In Washington, a senior military official said the deal has been accepted by the U.S. side, short of formal approval by President Bush, but is subject to final acceptance by Iraqi leaders. 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 publicly announced and are not final.

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 less visible parts of the country, and would be ready to assist 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 date linked to the attainment of certain agreed-upon goals.

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 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.

In Washington, White House spokeswoman Dana Perino said talks with the Iraqis were ongoing and "we are trying to bring the agreement to a close. It is not done yet."

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.

Burns reported from Washington.