He was responding to a question from a Pakistani reporter about whether a deal struck bywith Taliban fighters in the restive Swat valley could serve as a model for .
On Monday, Pakistan announced it would agree to the imposition of Islamic law in the northwest valley as part ofafter an 18-month military campaign. The pact was spearheaded by a hard-line cleric who is negotiating with the Taliban in the valley to give up their arms.
A reporter from Pakistan's Geo Television brought up the Swat deal and criticism of it by Richard Holbrooke, the Obama administration's envoy to the region.
The reporter asked whether, if Pakistan succeeds in pacifying militant activity in Swat, the United States would allow Afghans to make a similar type of agreement.
Gates replied: "If there is a reconciliation, if insurgents are willing to put down their arms, if the reconciliation is essentially on the terms being offered by the government then I think we would be very open to that.
"We have said all along that ultimately some sort of political reconciliation has to be part of the long-term solution in Afghanistan," Gates said.
Later, Pentagon spokesman Geoff Morrell said: "The secretary is too polite to take issue with the premise of the question, but he was in no way equating the prospect for reconciliation in Afghanistan with whatever deal the Pakistani government may or may not be trying to cut with militants in Swat province."
U.S. interest in the possibility of future talks with moderate Taliban elements is not new. Military commanders, including Gen. David Petraeus, have suggested that such efforts, if led by Afghan officials, would be useful.
Afghanistan's government has said it wants to persuade Taliban guerrillas who are not "hard-liners" to lay down their arms in return for a political role in the country. But representatives of the Taliban, who have made significant military gains in the last two years and now control vast swathes of countryside, say they will not negotiate while foreign troops remain in Afghanistan.
A similar deal in Swat last year collapsed in a few months and was blamed for giving insurgents time to regroup.
Gates also welcomed the fact that NATO nations have signaled a willingness to provide more troops or other assistance to the war effort in Afghanistan, even though the meeting ended with no firm commitments on either.
The meeting in Krakow came amid intense diplomatic efforts to secure alternate supply routes to Afghanistan, to augment the main logistical lines through Pakistan which have been under increasing rebel attack.
Complicating matters further for the U.S. and for NATO, Kyrgyzstan, the site of a major U.S. air base used to fly troops and supplies to Afghanistan, on Friday ordered U.S. forces to depart within six months.
But Russia and several other Central Asian states have said they would allow NATO to ferry supplies by rail to the borders of Afghanistan, thus easing the supply squeeze faced by the alliance.
NATO Secretary-General Jaap de Hoop Scheffer said a broader regional approach could one day include Iran.