Defense Secretary Robert Gates speaks to U.S. Army 25th Infantry Division troops from Hawaii during a visit to Camp Victory in Baghdad on Thursday. (Chip Somodevilla/Getty Images)

— U.S. defense officials have expressed growing confidence this week that Iraqi leaders want a modest American military presence to continue in Iraq beyond the year-end deadline for troops to be withdrawn.

But that confidence — echoed Friday by visiting Defense Secretary Robert M. Gates after a meeting with Massoud Barzani, president of Iraq’s semi-autonomous Kurdish region — raises another set of questions for U.S. officials: How large a force do the Iraqis want? What functions do they want it to fulfill? And will a request come in time for U.S. officials to get that force in place as they face pressing demands elsewhere, as well as the consuming project of packing up most of the American force in Iraq?

A U.S. soldier based in the northern Iraqi city of Mosul asked Gates in a question-and-answer session about the possibility that Iraqi leaders would ask for some of the 47,000 remaining troops to stay beyond the end of the year.

“That’s what my visit here has been all about,” Gates replied, before naming several of the top Iraqi leaders he had met with over a three-day stop in the country. “My basic message to them was, if there is to be a presence to help them with some areas where they still need help, we’re open to that possibility. But they have to ask, and time is running out.”

Gates added, “It obviously would be a presence that’s a fraction of the size of what we have here now.”

Shortly after his remarks to the troops in Mosul, Gates told reporters that, based on his meeting with Barzani, there is “interest” in having troops stay longer. “So I’m hopeful that Iraqi leaders will consult and let us know one way or the other,” he said.

His meeting with Barzani took place in Irbil, the capital of the Kurdish region. After Gates completed his visits in northern Iraq on Friday, he flew to the United Arab Emirates. He also met with Saudi King Abdullah in Riyadh on Wednesday.

The efforts to negotiate a U.S. military presence past the end of the year in Iraq have been complicated by political turmoil in Baghdad. Iraq’s fragile governing coalition has neither a defense nor an interior minister.

The U.S. State Department plans to take over some functions now provided by the Defense Department. But U.S. officials have been blunt about the limitations of Iraq’s military capabilities, especially in battling a potential foreign foe. Iraq still has very limited air power, and it relies on U.S. help for logistics and aerial intelligence-gathering. U.S. forces also provide crucial training and advice to the Iraqi military.

The issue of a continued U.S. military presence is treacherous in Iraq, where leaders are eager to resume control of security but fear that ongoing political trouble could lead to more violence. Al-Qaeda in Iraq took credit for a bombing in Tikrit last week that killed more than 57 people.