Updated

Defense Secretary Robert Gates said the Bush administration will take into account Iraq's political progress when deciding this summer whether or not to bring home some of the thousands of extra troops the U.S. has sent to tamp down violence there.

"Our commitment to Iraq is long-term, but it's not a commitment to having our young men and women patrolling Iraq's streets open-endedly," Gates said at a press conference.

Gates said he encouraged the Iraqis to pass legislation on political reconciliation and the sharing of oil revenues among the Sunnis, Shiites and Kurds. He told the Iraqis he hoped their Council of Representatives would not recess for the summer without passing the legislation.

Whether they take action on these measures will be considered when he and the commanders review the military buildup later this summer, Gates told them.

Gates' remarks reflected the Bush administration's effort to strike a balance between reassuring the Iraqis of U.S. support and pressuring their leaders to use this opportunity to show they are capable of bringing the country together and averting a full-scale civil war.

Bush hinged his new Iraq strategy not only on the troop buildup but also on the prospect that the Iraqis would demonstrate that they can reconcile the sectarian divisions that are behind much of the daily violence.

Gates said Prime Minister Nouri al-Maliki assured him that the prime minister and the council want to "work very hard" to bring about these changes. But al-Maliki also reminded Gates that the council is an independent body.

At the news conference with Gates, Iraqi Defense Minister Abdul-Qader al-Obaidi said the Iraqis are making progress in countering the insurgency.

"Our need for support is getting less and less each day," al-Obaidi said.

Gates said he was "modestly optimistic that we will see steady progress" in combatting the violence. But, he said, "There probably will be tough days to come."

Gates said the U.S. troop buildup will continue at least until late summer. "We need some time for things to work," he said.

He assured al-Maliki that the U.S. continues to be committed to the Iraqi government and the Baghdad security plan, Gates said.

He rejected Senate Majority Leader Harry Reid's assessment that the war was already lost and the troop buildup was not stemming violence in Iraq. "I respectfully disagree," Gates said when asked by a reporter about Reid's Thursday remarks.

Gates' unannounced stop in Iraq began Thursday, and throughout the visit he took a decidedly stronger tone, warning the troubled nation's leaders that American patience is wearing thin and urging them to quickly unite their warring factions.

Gates had planned to take a look Friday at a key piece of the Bush administration's new anti-insurgency strategy, a joint US-Iraq security post where American and Iraqi forces live and work together to try to stop the violence that is ripping Baghdad. That tour, however, was abruptly canceled, and defense officials traveling with Gates said it was because his meeting with top U.S. commanders went longer than anticipated.

Gates huddled in the former Al Faw Palace at Camp Victory for nearly three hours Friday morning with Joint Chiefs Chairman Gen. Peter Pace; the top Middle East commander, Adm. William Fallon; and Gen. David Petraeus and Lt. Gen. Ray Odierno, the No. 1 and 2 commanders in Iraq.

The session centered on operations in Iraq, as well as the progress of the ongoing military buildup, and it came as Gates ratcheted up the pressure on the Iraqi political leaders.

"The clock is ticking," Gates told reporters Thursday. "I know it's difficult, and clearly the attack on the Council of Representatives has made people nervous, but I think that it's very important that they bend every effort to getting this legislation done as quickly as possible."

A suicide bomber infiltrated the parliament building in the heavily fortified Green Zone a week ago, dealing a blow to the U.S.-led effort to pacify the capital's streets.

Three of the five extra brigades Bush ordered into Iraq to stem violence have arrived. Officials want the rest in place by June, for a total of 160,000. Soon after that, they will assess how much longer the higher troop level — about 30,000 more than before the buildup — will be needed.