Washington (CNN) -- Deep disagreements surfaced on Capitol Hill Tuesday over whether the United States has moved too quickly to withdraw troops from Iraq.
The Obama administration will withdraw all U.S. military personnel by the end of the year, after negotiations with Iraq broke down last month over leaving behind a small force for training and security. Some 30,000 U.S. troops remain in Iraq now, and only a small number of U.S. military will remain behind, attached to the U.S. embassy in Baghdad.
Sen. John McCain, R-Arizona, said the failure to revise the withdrawal timetable and leave a small U.S. force behind is what he called a sad example of political expediency supplanting military necessity.
"It will have serious negative consequences for the stability of Iraq and the national security interests of the United States," McCain said.
And McCain said the withdrawal will hurt Iraq and benefit its long-time regional rival. "It is hard to see the withdrawal of U.S. forces from Iraq as anything but a win for Iran," he said.
The withdrawal schedule originally was agreed to by the Bush administration.
McCain was speaking at a Senate Armed Services Committee hearing to hear from Defense Secretary Leon Panetta and Joint Chiefs Chairman Gen. Martin Dempsey.
Panetta said Iraq can stand on its own, cope with extremist violence and internal political divisions as well as next-door Iran.
"To be sure, Iraq faces a host of remaining challenges, but I believe Iraq is equipped to deal with them," Panetta told the committee.
"This outcome was never certain, especially during the war's darkest days," Panetta said. "It is a testament to the strength and resilience of our troops that we helped the Iraqi people reverse a desperate situation and provided them the time and space to foster the institutions of representative government."
McCain and Panetta clashed directly over whether the United States had really tried to negotiate, with specific numbers and a detailed description of the mission, to provide a small residual force beyond December 31 with the necessary legal immunity.
McCain claimed the Obama administration had failed to negotiate in good faith and was instead committed to complete withdrawal.
"The truth is that this administration was committed to the complete withdrawal of U.S. troops form Iraq and they made it happen,' McCain said.
"Senator McCain, that simply is not true," Panetta said.
"Your version of history and mine are very different," McCain told Panetta after that particularly sharp exchange.
Dempsey took a more cautious tact in describing Iraq's ability to function. "In anticipation of the question about whether I'm concerned about the future of Iraq-the answer is yes," Dempsey said.
McCain asked Dempsey whether there were any U.S. military commanders in favor of full withdrawal. "No, senator, none of us recommended that we completely withdraw from Iraq," Dempsey replied.
Panetta did not rule out that negotiations with Iraq about a small U.S. force could resume later.
One consequence of the U.S. military withdrawal is that the U.S. State Department will require some 16,000 private contractors to provide security and other services, like transportation and medical evacuation, that had been provided by the Pentagon.
"No question there are risks involved here," Panetta said about such a large, unprecedented reliance on contractors.
"Are there going to be risks associated with contractor? Yes," Panetta said. "Do we have any other alternatives? No."