Whether to negotiate an extended U.S. military presence is up to the Iraqis, he said, adding that he thought an extension might make sense.
"We are willing to have a presence beyond (2011), but we've got a lot of commitments," he said, not only in Afghanistan and Libya but also in Japan, where he said 19 U.S. Navy ships and about 18,000 U.S. military personnel are assisting in earthquake, tsunami and nuclear reactor relief efforts.
"So if folks here are going to want us to have a presence, we're going to need to get on with it pretty quickly in terms of our planning," he added. "I think there is interest in having a continuing presence. The politics are such that we'll just have to wait and see because the initiative ultimately has to come from the Iraqis."
The U.S. now has about 47,000 troops in Iraq, and they will begin leaving in large numbers in late summer or early fall. The U.S. led an invasion in March 2003 that toppled the government of President Saddam Hussein a month later, but an insurgency soon set in and the U.S. got mired in a conflict that has lasted far longer - and cost far more American and Iraqi lives - than Washington had anticipated.
Gates also said civil unrest in the Persian Gulf kingdom of Bahrain, with majority Shiite Muslims pushing for an end to rule by the minority Sunnis, has created tensions in Iraq, whose Shiite prime minister, Nouri al-Maliki, is concerned about Bahrain's crackdown on Shiites.
Gates said he expected to discuss this subject with al-Maliki in private meetings later Thursday.
Under blue skies and a bright sun at a U.S. base just outside the Iraqi capital, Gates told a group of soldiers that he worries that a potential shutdown of the U.S. federal government will delay issuance of their paychecks. He assured them that they eventually would get full pay, but there could be a delay if Democrats and Republicans in Washington are unable to reach a budget deal this week.
"When I start to think of the inconvenience that it's going to cause these kids (soldiers) and a lot of their families, even a half paycheck delayed can be a problem for them," Gates told reporters after fielding several questions from the assembled soldiers. The first question posed to him was by a soldier asking about the ramifications for military members and their families of the budget crisis back home.
Gates assured them, "You will be paid," then added that it might take a while, depending on the length of the political impasse in Washington.
In a brief exchange with reporters during a photo session with Gates earlier Thursday, the U.S. ambassador to Baghdad, James Jeffrey, said U.S. ground forces are "the glue" that is holding the country together. He said this leaves a mixed picture of the situation in Iraq because making arrangements to keep U.S. troops here beyond December is going to be difficult.
In his troop talk, Gates raised the matter of his impending retirement, recalling for soldiers of the 2nd Brigade, 1st Infantry Division, that his first visit to Iraq was in September 2006, three months before he replaced Donald H. Rumsfeld as defense secretary. He recalled that on a visit to Baghdad in December 2006 he conducted a press conference while a gun battle was echoing in the distance.
In all, he estimated he has made 14 visits to Iraq.
"'This will probably be my last one," he said.
Gates previously has said he intends to retire this year, but he has not been more specific about the timing. It is widely anticipated that he is planning to quit this summer.