KABUL, Afghanistan (AP) -- The Taliban and the U.S. said Tuesday they will hold talks on finding a political solution to ending nearly 12 years of war in Afghanistan, as the international coalition formally handed over control of the country's security to the Afghan army and police.
The Taliban met a key U.S. demand by pledging not to use Afghanistan as a base to threaten other countries, although the Americans said they must also denounce al-Qaida.
But President Barack Obama cautioned that the process won't be quick or easy. He described the opening of a Taliban political office in the Gulf nation of Qatar as an "important first step toward reconciliation" between the Islamic militants and the government of Afghanistan, and predicted there will be bumps along the way.
Obama, who was attending the G-8 summit in Northern Ireland, praised Afghan President Hamid Karzai for taking a courageous step by sending representatives to discuss peace with the Taliban.
"It's good news. We're very pleased with what has taken place," U.S. Secretary of State John Kerry said in Washington. British Prime Minister David Cameron, whose country has the second-largest contingent of troops in Afghanistan after the U.S., called opening the office "the right thing to do."
As the handover occurred, four U.S. troops were killed Tuesday at or near Bagram Air Base in Afghanistan, U.S. defense officials said. The officials said the four were killed by indirect fire, likely a mortar or rocket, but they had no other details. The officials spoke on condition of anonymity because they were not authorized to provide details on the deaths.
Officials with the Obama administration said the office in the Qatari capital of Doha was the first step toward the ultimate U.S.-Afghan goal of a full Taliban renunciation of links with al-Qaida, the reason why America invaded the country on Oct. 7, 2001, shortly after the Sept. 11 terrorist attacks against the United States.
The officials, who spoke on condition of anonymity because they were not authorized to speak on the record, said U.S. representatives will begin formal meetings with the Taliban in Qatar in a few days.
The top U.S. commander in Afghanistan, Marine Gen. Joseph Dunford, said the only way to end the war was through a political solution.
"My perspective has always been that this war is going to have to end with political reconciliation, and so I frankly would be supportive of any positive movement in terms of reconciliation, particularly an Afghan-led and an Afghan-owned process that would bring reconciliation between the Afghan people and the Taliban in the context of the Afghan constitution," he said.
Dunford added that he was no longer responsible for the security of the country now that Afghan forces had taken the lead.
"Last week I was responsible for security here in Afghanistan," he said, adding that now it was Karzai's job. "It's not just a statement of intent -- it's a statement of fact."
The transition to Afghan-led security means U.S. and other foreign combat troops will not be directly carrying the fight to the insurgency, but will advise and back up as needed with air support and medical evacuations.
The handover paves the way for the departure of coalition forces -- currently numbering about 100,000 troops from 48 countries, including 66,000 Americans. By the end of the year, the NATO force will be halved. At the end of 2014, all combat troops will have left and will replaced, if approved by the Afghan government, by a much smaller force that will only train and advise.
Obama has not yet said how many soldiers he will leave in Afghanistan along with NATO forces, but it is thought that it would be about 9,000 U.S. troops and about 6,000 from its allies.
It is uncertain if the Afghan forces are good enough to fight the insurgents. The force numbered less than 40,000 six years ago and has grown to about 352,000 today.
In some of the most restive parts of the country, it may still take a "few months" to hand over security completely to the Afghans, Dunford said.
The transition comes at a time when violence is at levels matching the worst in 12 years, further fueling some Afghans' concerns that their forces aren't ready.
The decision to open the Taliban office was a reversal of months of failed efforts to start peace talks while the militants intensified a campaign targeting urban centers and government installations.
Experts warned that it would be a mistake to expect too much.