The United States should maintain a long-term military presence in Afghanistan as a “tenant” on bases jointly occupied with Afghan forces, rather than on permanent U.S. bases, after its combat mission ends, according to Defense Secretary Robert M. Gates.

“Bases that belong to one country in another country are always a magnet for trouble,” he said in an interview with Afghanistan’s Tolo News that was released Wednesday. “Joint bases,” from which U.S. troops could provide ongoing training and other assistance, would be “more tolerable to the Afghan people,” he said.

As President Obama determines how many U.S. troops will come home in initial withdrawals next month — with all combat forces to be gone from Afghanistan by the end of 2014 — the administration is negotiating a “strategic partnership” agreement with the Kabul government for the longer term.

Obama has said he expects the U.S. presence to gradually transition over the next several years to more of a traditional diplomatic and foreign assistance role, although an unspecified number of U.S. troops are expected to remain.

The Obama administration has repeatedly said that it plans no permanent bases in Afghanistan, but its negotiations with the Afghans about specific numbers, missions and locations have remained secret. Some Afghans, including senior officials, favor permanent bases as an expression of U.S. commitment, while others have said they would prefer no U.S. military presence.

The Taliban, with which the U.S. and Afghan governments hope to negotiate an eventual peace accord, has placed the withdrawal of all foreign military forces at the top of its list of demands. About 100,000 U.S. troops, and 40,000 from NATO and other partners, are now in Afghanistan.

The U.S.-Afghan agreement, similar in concept to one the United States signed with Iraq as it began to wind down its military presence there, is due to be completed this summer.

Ryan C. Crocker, who has been nominated as U.S. ambassador to Afghanistan, discussed the agreement before the Senate Foreign Relations Committee on Wednesday, calling it a “political framework document [that] will help normalize our relationship and provide a road map for our political, economic and security cooperation.”

Crocker’s confirmation hearing was a virtual love-fest, as senator after senator expressed admiration for and confidence in the abilities of one of the most senior U.S. diplomats, who was called out of retirement to take over the Kabul mission. Crocker’s last post was Iraq, where he is credited with playing a major role in reversing a war that seemed to be spiraling out of control and with managing the difficult U.S. civilian-military relationship on the ground.

“I’m under no illusions of the difficulty of the challenge,” Crocker told lawmakers who questioned the cost and the length of the Afghan war. “If Iraq was hard — and it was hard — Afghanistan, in many respects, is harder.” But, he said, it is not “hopeless.”

“We’re not out to, clearly, create a shining city on a hill. That’s not going to happen,” he said. But “there needs to be progress.”

In addition to recent military victories, he said, gains have been made on the civilian front, including education projects that now provide schooling for 7 million Afghan children — including 2.5 million girls — and programs that have provided health-care facilities for millions of people nationwide.

The administration took issue Wednesday with some of the conclusions drawn in a report on U.S. reconstruction aid to Afghanistan by the committee’s majority-Democratic staff. Although it praised the education and health programs and other such efforts, the report described much of the $19 billion spent on civilian aid since 2002 as having only limited success, and it questioned whether the programs are sustainable without continued massive flows of U.S. and other foreign funding.

Written responses to the report by Deputy Secretary of State Thomas R. Nides and Rajiv Shah, administrator of the U.S. Agency for International Development, noted that the Obama administration has already undertaken many of the report’s proposals for increased oversight of spending and building the Afghan government’s capacity to sustain U.S.-funded programs over the long term.

“While we obviously agree with some aspects of it . . . we don’t believe that its assessment of the overall progress is the same as ours,” White House spokesman Jay Carney said of the report.