KABUL, Afghanistan — The United States is beginning to decide what its responsibilities will be in Afghanistan after U.S. combat troops leave, Defense Secretary Robert Gates said Monday, but he ruled out permanent military bases in the strategically important country.

President Hamid Karzai wants U.S. military support even as he heavily criticizes the current U.S.-led military campaign for being too quick on the trigger. Nine Afghan boys died in an accidental air strike last week, reopening a raw issue.

Gates said the U.S. is interested in keeping a military presence in this former al-Qaida haven beyond the planned end of combat in three years. At a news conference with Karzai, Gates said a team of U.S. officials would arrive here next week to begin negotiations over a new compact for U.S.-Afghan security relations after 2014, when all international combat forces are supposed to be gone. U.S. forces have been in Afghanistan since 2001, and President Barack Obama has repeatedly said the war is not open-ended.

The Pentagon chief also said the U.S. and its allies will be "well positioned" to begin withdrawing forces in July this year, although he gave no specifics. The withdrawal would continue through 2014, with Afghan forces gradually taking over the fight against the Taliban-led insurgency.

Gates' promise to draft a post-2014 "strategic partnership" with this poor, unstable nation is meant to reassure the mercurial Karzai, who fear that he and the country's fragile civilian government might be overthrown without U.S. military backing. It is not clear how far-reaching or binding the document would be.

Vexing questions remain about whether Kabul will be ready to govern by 2015 and prevent a return to extremist Taliban rule.

Gates opened his remarks by offering a personal apology for the children's deaths last week, an incident that had prompted Karzai on Sunday to issue a statement calling the deaths unacceptable and reject an apology issued by U.S. Gen. David Petraeus, the top commander of American and NATO forces in the country.

"This breaks our hearts," Gates said of the deaths. He called it a setback, too, for U.S. ties to the Afghan people — a relationship that is central to Petraeus' strategy for countering the Taliban insurgency by winning the loyalty of ordinary Afghans.

Asked by a reporter whether he accepted Gates' apology, Karzai said, "I trust him fully when he says he's sorry." He added that words alone from even the most senior American defense official was not enough for Afghans tired of civilian casualties.

"They want it not reduced — they want it stopped," Karzai said.

The top U.S. commander in the area where the nine Afghan boys were killed, Army Maj. Gen. John Campbell, told reporters traveling with Gates that the incident was regrettable, but he also said without offering any details, "there is a lot more to that story." He said it is still being investigated.

Campbell said 90 percent of civilian casualties in his area of responsibility are caused by the Taliban.

Gates arrived Monday on a two-day visit intended to give him a first-hand sense of how Obama's war strategy is faring, and whether it is on track to sufficiently weaken the Taliban while building up the capacity of Afghanistan's own army and police.

"While no decisions on numbers have been made, in my view we will be well positioned to begin drawing down some U.S. and coalition forces this July, even as we redeploy others to different areas of the country," he said. He immediately added a reassurance to Karzai that, "we are not leaving" this summer. "Come September, October and beyond, there will still be substantial numbers of coalition troops still partnering with Afghans," he said.

Karzai and Gates both mentioned that their discussions included the topic of negotiating a strategic partnership, which in Karzai's eyes is a way to parlay the enormous U.S. investment in blood and treasury since 2001 into the foundations of long-term stability.

"The specifics remain to be negotiated," Gates said. "But I would say that if the Afghan people and the Afghan government are interested in an ongoing security relationship," with some level of U.S. military presence, "The United States I think is open to the possibility of having some presence here in terms of training and assistance," possibly using Afghan bases.

"We have no interest in permanent bases" for the U.S., he said. "But if the Afghans want us here, we are certainly prepared" to stay.

Negotiations over a post-war security agreement with Afghanistan recall the struggle to fashion a security compact with Iraq three years ago, although these talks are unlikely to be as contentious. In both cases the United States had an interest in ensuring that chaos did not follow a U.S. withdrawal, allowing a new foothold for al-Qaida. What's different is that the U.S. has a written agreement with Iraq that requires all U.S. forces to depart at the end of this year unless the Iraqi government reopens the question and invited the U.S. to stay.

Earlier, during an encounter with U.S. troops at Bagram air base, Gates said he thought the U.S. and Afghanistan were both interested in a longer-term U.S. military presence.

"Obviously it would be a small fraction of the presence that we have today, but I think we're willing to do that," Gates told the soldiers. "My sense is, they (Afghan officials) are interested in having us do that."

This week's visit is Gates' 13th trip to Afghanistan, and probably one of his last as defense secretary. He has said he will retire this year but has not given a date.

After Afghanistan, Gates planned to fly to the Stuttgart, Germany, headquarters of U.S. Africa Command to attend a ceremony Wednesday marking the arrival of a new commander, Army Gen. Carter Ham.

Gates will attend a NATO defense ministers meeting in Brussels on Thursday and Friday.