* U.S. official says talks to start on Thursday in Doha
* Peace process will not be easy or quick; could take years
* Obama anticipates "a lot of bumps in the road"
* Afghans say Taliban has agreed to meet government
The United States will meet the Taliban this week for talks aimed at achieving peace in Afghanistan, where U.S.-led forces and the insurgents have fought a bloody and costly war for the past 12 years, U.S. officials said on Tuesday.
The Taliban opened an office in Doha, the Qatari capital, on Tuesday to help restart talks and said it wanted a political solution that would bring about a just government and end foreign occupation of Afghanistan.
A senior U.S. official said the talks would start in Doha on Thursday, but President Barack Obama cautioned against expectations of quick progress, saying the peace process would not be easy or quick.
U.S. officials said the process could take many years and be subject to reversals.
"This is an important first step towards reconciliation; although it's a very early step," Obama said after a G8 meeting in Enniskillen, Northern Ireland.
"We anticipate there will be a lot of bumps in the road."
U.S. officials say they hope the meeting will open the way for the first-ever official peace talks between the government of Afghan President Hamid Karzai and the Taliban, which has waged a 12-year campaign to oust him and foreign troops.
The Taliban have until now said they would not countenance talks with the government, which they consider a stooge of the United States and other Western states in the NATO coalition fighting in Afghanistan.
News of the planned talks comes as the United States and its allies in NATO seek to meet a deadline of December 2014 for an end to foreign combat operations in Afghanistan.
This would allow them to withdraw the majority of their troops and wind down an engagement launched after the Sept. 11 attacks on the United States in 2001 that has cost hundreds of billions of dollars and tens of thousands of lives.
A senior Afghan official said the Taliban was now willing to consider peace talks with the government, having held secret discussions with government representatives.
In opening the Qatar office, the Taliban said it sought a political solution, but said no dates had been agreed for talks.
Taliban representative Mohammed Naeem told a news briefing the group wanted good relations with "all of the world countries."
"But the Islamic emirate (Taliban) sees the independence of the nation from the current occupation as a national and religious obligation," he said.
U.S. officials said that in the talks in Doha, the United States would stick to its insistence that the Taliban break ties with al Qaeda, end violence, and accept the Afghan constitution, including protection for women and minorities.
For its part, the Taliban is expected to demand the return of prisoners now at the U.S. military prison at Guantanamo Bay in Cuba - a move many in the U.S. Congress oppose - as well as the departure of all foreign troops.
The United States says it hopes to keep a force, of as yet undetermined size, in the country after the end of the NATO combat mission.
The talks will be the first U.S. meeting with the Taliban in several years. U.S. officials said the initial meeting was expected to involve an exchange of agendas, followed by another meeting a week or two later to discuss next steps.
A U.S. official said he expected the initial meeting would be followed within days by another between the Taliban and the High Peace Council, a structure set up by Karzai to represent Afghanistan in such talks.
'PEACE IS NOT AT HAND'
The U.S. officials, who spoke on condition of anonymity, said the level of trust between the Afghan government and the Taliban remained low, and played down expectations that the talks would quickly lead to peace.
"We need to be realistic," said one official. "This is a new development, a potentially significant development. But peace is not at hand."
Obama said peace would only come through an Afghanistan-led process, and commended Karzai for taking a courageous step toward peace. He stressed that the U.S. military effort would continue in spite of the peace efforts.
"We don't anticipate this process will be easy or quick but we must pursue it in parallel with our military approach. And we in the meantime remain fully committed to our military efforts to defeat al Qaeda and to support the Afghan national security forces," Obama said.
Despite the accompanying words of caution, the announcement of the planned talks represents a significant step forward in the peace process, which has struggled to achieve results despite years of attempts.
A team of envoys from the Taliban flew to Qatar in early 2012 to open talks with the U.S. government. But the Taliban suspended the talks in March 2012, saying Washington was giving mixed signals on the nascent Afghan reconciliation process.
Tiny, gas-rich Qatar has been an enthusiastic supporter of reconciliation efforts in a number of crises affecting the Muslim world including those in Afghanistan, Yemen, Somalia, Lebanon and Darfur, often hosting peace talks on its own soil to try to prove it can punch above its weight in diplomacy.
Karzai, speaking on Tuesday as the U.S.-led NATO coalition launched a final phase of transferring responsibility for security to Afghan forces, said his government would send a team to Qatar. But he said the talks should quickly be moved to Afghanistan.
"We hope that our brothers the Taliban also understand that the process will move to our country soon," he said.
U.S. officials said the goal was to ensure that Afghanistan did not remain a haven for terrorist groups and to defeat al Qaeda, which was given sanctuary by the Taliban in Afghanistan.
"One of the things we will want to talk about from the very beginning is how they're going to cut ties with al Qaeda," a U.S. official said. "How quickly, exactly how they're going to do it, how quickly."
A senior U.S. official said Pakistan, which has provided sanctuary to the Taliban despite its professed support for the battle against Islamist militancy, had recently been supportive of the peace process.
"There has in the past been skepticism about their support, but in recent months I think we've seen evidence that there is genuine support and that they've employed their influence such as it is to encourage the Taliban to engage," he said.
A U.S. official said the talks would be conducted on the Taliban side by its political commission, with the authorization of Mullah Omar, and also represent the al Qaeda-linked Haqqani network. James Dobbins, the new special representative for Afghanistan and Pakistan, will lead the U.S. side.
The Haqqanis are considered the United States' deadliest foe in Afghanistan and the top U.S. and NATO commander in the country cast doubt on Tuesday over whether it could make peace.
"All I've seen of the Haqqani would make it hard for me to believe they were reconcilable," U.S. General Joseph Dunford told Pentagon reporters by phone from Kabul.
U.S. officials said they expected detainee exchanges to be discussed in the talks. The United States will ask for the safe return of U.S. Sergeant Bowe Bergdahl, who has been a prisoner since June 2009, the officials said. He is thought to be being held by Taliban militants in northwestern Pakistan.