A HORRIFIC terrorist attack on a provincial government headquarters in Iraq last week killed scores and prompted a rare intervention by U.S. troops stationed nearby. The attack was a reminder of two realities that are overlooked by many these days in Washington. First, political violence in Iraq, though dwindling, is still a near-daily occurrence, and escalation is a constant risk. Second, if nothing changes, nine months from now there will be no American troops in Iraq able to respond to emergencies or to help prevent the fragile gains of a costly war from unraveling.

According to an agreement negotiated by the Bush administration, all U.S. troops are to leave Iraq by the end of 2011. Though many expected that the two governments would negotiate a follow-on agreement for a limited American deployment, both Iraqi Prime Minister Nouri al-Maliki and President Obama have said repeatedly that they intend to stick to the plan. If they do, military experts warn, next year Iraq will lack critical defense capacities: It will be unable to defend its airspace or borders, protect oil shipments or platforms in the Persian Gulf, or partner with U.S. special forces in raids against al-Qaeda.

Perhaps most seriously, American soldiers who have been serving as de facto peacekeepers in the city of Kirkuk and along the sensitive border zone between Iraqi Kurdistan and the rest of the country will disappear. Many experts believe that in their absence violence could erupt between Kurds and Arabs.

The State Department has an ambitious plan to compensate for some of the departing military forces with a mission of as many as 17,000 personnel, including thousands of security contractors. However, even if Congress provides State with the $6 billion necessary — something that is in doubt — experts question whether the embassy can provide adequate protection for its diplomats in places such as Kurdistan without regular ground forces. Diplomats, however capable, won’t be able to carry out the patrols and provide the deterrence that has kept the peace.

After the thousands of American lives lost and billions spent, it would be tragic if Iraq collapsed again into war or fell prey to Iran or other neighbors because of a security vacuum created by the U.S. withdrawal. Officials say that the White House has not ruled out the negotiation of a follow-on military presence. But the administration’s position is that any such proposal must come from the Iraqi government.

For the moment, that doesn’t look likely. While many Iraqis, especially in Kurdistan, favor a continued U.S. presence, not many are ready to argue for it publicly. Meanwhile, Iran’s allies, led by cleric Moqtada al-Sadr, vehemently oppose any extension. At present, Iraq lacks a defense minister or a national security adviser to make the case for the country’s needs — Mr. Maliki has failed to make appointments to those jobs since forming his government late last year.

With time running out, the United States should be looking for ways to get around this impasse. A NATO training mission already operates in Iraq and could be extended and expanded; so could a planned U.S. office of defense cooperation. At a minimum, U.S. officials and commanders should be briefing Iraq political leaders on the consequences of a full American withdrawal and disabusing them of any illusions that Mr. Obama will come forward with an initiative. If Mr. Maliki does bring himself to propose a new force agreement, it’s likely he will delay as long as he can. The administration should be prepared to respond to a last-minute initiative.