Defense Secretary Robert M. Gates told a Senate committee Thursday that everything the United States has accomplished in Iraq is potentially at risk if the State Department does not get the money it has requested to fund its work there as U.S. forces exit this year.

In an impassioned plea during a Senate Armed Services Committee hearing on next year's Pentagon budget, Gates cited the loss of more than 4,000 American lives in Iraq and the expenditure of some $900 billion.

He said it is "a critically urgent concern" that a planned $5.2 billion allocation for fiscal 2012 be approved, so that the State Department can carry on the training of Iraqi police and other programs once handled by the Pentagon.

He pointed out that because current funding is limited by the continuing resolution for fiscal 2011, which allots funds at 2010 levels, the State Department "can't spend the money to get ready right now. . . . There are facilities to be built. There are people to be hired. And they can't do any of that. And so we're going to run out of time in terms of being able to get this accomplished."

The situation, Gates said, reminded him of the 1980s, when "we spent billions to drive the Soviets out of Afghanistan, and we couldn't get a million dollars to build schools in Afghanistan in 1989 and 1990," and eventually the Taliban took over.

If the State Department does not get the needed funds, he added, "the same thing is going to happen in Iraq."

Gates's plea drew bipartisan support from members.

Sen. Lindsey O. Graham (R-S.C.) described the transition as "surging on the civilian side. . . . As we draw down our troops, the civilian-military partnership is essential to holding and building."

Graham is the ranking Republican on the Senate Appropriations subcommittee that funds a portion of the State Department program, and he said, "I would like to treat those funds as a national security asset, and I will do everything I can on the Republican side in the Senate to make sure that we protect those funds."

Sen. Carl Levin (D-Mich.), chairman of the Armed Services Committee, agreed that the transition "can only be successful if the Department of State and our other civilian agencies receive the resources that they need to take on these missions."

Graham also raised the question of whether additional U.S. troops should remain in Iraq after the end of this year, when all are scheduled to leave under the strategic agreement that was signed with the Iraqi government during the George W. Bush administration.

Gates had said that about 150 military and 200 civilian contractors would be working through the U.S. Embassy in Baghdad to manage the arrival of primarily American weaponry purchased by Iraq through the U.S. foreign military sales program.

Graham asked Gates whether it wouldn't be better for the U.S. military to provide needed security, rather than having the State Department hire a "private contractor army." The defense secretary agreed.

Gates disclosed that there have been informal talks with the Iraqis about the possibility of a new agreement for some U.S. forces to remain after Dec. 31 to help with intelligence, logistics and air defense.

But the defense secretary said that because the presence of American troops remains unpopular in the country, no Iraqi political leader wants "to be the first one out there supporting it." He said his hope was that once a new Iraqi defense minister is named, "we will be able to move forward with this dialogue with the Iraqis."