Updated

Representatives from the United States and the Taliban will engage in Afghanistan peace talks Thursday in an office that has opened in Qatar, senior U.S. administration officials say.

The officials say detainee exchanges will likely be among the topics discussed in the Doha office, which opened Tuesday after months of delays. Afghan President Hamid Karzai's High Peace Council is expected to follow up with its own talks a few days later.

The first meeting will focus on an exchange of agendas and consultations on next steps.

The Taliban’s spokesman, Zabiullah Mujahid, said in a statement emailed to The Associated Press that the group opposes the use of Afghan soil to threaten other countries and supports the negotiating process.

Zabiullah said that the Taliban are willing to use all legal means to end what they called the occupation of Afghanistan.

State Department Spokeswoman Jen Psaki said during a press briefing Tuesday that "an Afghan led and Afghan owned peace and reconciliation process is the surest way to end violence and ensure lasting stability in Afghanistan and the region."

"You know, these statements represent an important first step towards reconciliation, the outcome of which must be that the Taliban and other insurgent groups break ties with Al Qaeda and violence and accept Afghanistan's constitution including its protections for women and minorities," she said.

Zabiullah thanked the leader of Qatar for allowing them to open the office, which was assisted by months of secret Taliban negotiations in Norway, according to Reuters.

"We have played a key role in this process," Foreign Minister Espen Barth Eide said Eide told NRK, a Norwegian broadcaster. "It has been a strictly confidential process but we can now reveal it."

Officials also said that Obama was personally involved in working with Karzai to enable the opening of the office, and that U.S. Secretary of State John Kerry had also played a major role. Obama, who was in Northern Ireland for a meeting of the Group of 8 industrial nations, briefed fellow leaders at the summit on opening of the office. Those leaders include the heads of the U.K., Russia, Canada, France and Italy, among others.

The U.S. administration officials, who spoke to the Associated Press on condition of anonymity because they were not authorized to speak on the record, say the peace process will be "complex, long and messy" because of the ongoing level of distrust between the parties.

Despite Karzai's stated hopes that the process will move almost immediately to Afghanistan, however, U.S. officials do not expect that to be possible in the near future.

"We are hopeful that after starting negotiations in Qatar, immediately the negotiations and all the peace process should move into Afghanistan. Afghanistan shouldn't be center of the discussions outside of the country," Karzai said.

The Taliban have for years refused to speak to the government or the Peace Council, set up by Karzai three years ago, because they considered them to be American "puppets." Taliban representatives have instead talked to American and other Western officials in Doha and other places, mostly in Europe.

"We don't have any immediate preconditions for talks between the Afghan peace council and the Taliban, but we have principles laid down," Karzai said, adding that they include bringing an end to violence and the movement of talks to Afghanistan so they are not exploited by other countries.

The announcements came on the day that Afghan forces took the lead from the U.S.-led NATO coalition for security nationwide, marking a turning point for American and NATO military forces, which will now move entirely into a supporting role. It also opens the way for the full withdrawal of most foreign troops in 18 months

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 as reports were breaking that the Taliban were about to open an office.

For U.S. and other foreign combat troops on the ground, the transition means they will not be directly carrying the fight to the insurgency, but will advise and back up as needed with air support and medical evacuations.

"This is a historic moment for our country and from tomorrow all of the security operations will be in the hands of the Afghan security forces," Karzai said at the ceremony, held at the new National Defense University built to train Afghanistan's future military officers.

The transition also comes at a time when violence is at levels matching the worst in 12 years, fueling some Afghans' concerns that their forces aren't ready.

Karzai said that in the coming months, coalition forces will gradually withdraw from Afghanistan's provinces as the country's security forces replace them.

In announcing the fifth and final phase of a process that began at a November 2010 NATO summit in Lisbon, Portugal, Karzai said "transition will be completed and Afghan security forces will lead and conduct all operations."

NATO Secretary-General Anders Fogh Rasmussen said the coalition will help militarily if and when needed but will no longer plan, execute or lead operations.

Alliance training since 2009 dramatically increased the size of the Afghan National Security Forces, bringing them up from 40,000 men and women six years ago to about 352,000 today. After transition, coalition troops will move entirely into a supporting role -- training and mentoring, and in emergency situations providing the Afghans backup in combat, mainly in the form of airstrikes and medical evacuation.

Afghans will now have the lead for security in all 403 districts of Afghanistan's 34 provinces. Until now, they were responsible for 312 districts nationwide, where 80 percent of Afghanistan's population of nearly 30 million lives. Afghan security forces were until now carrying out 90 percent of military operations around the country.

The handover paves the way for coalition forces -- currently numbering about 100,000 troops from 48 countries, including 66,000 Americans -- to leave. 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.

President 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.

The Associated Press contributed to this report.