Media playback is unsupported on your device Media caption The BBC's Aleem Maqbool: "You can see that there is still a white flag hanging there"

A row over the status of the Taliban's newly-opened office in Doha, Qatar, continues to frustrate efforts to start Afghan peace talks there.

After a rebuke from the Qataris, the Taliban removed a nameplate and a flag, only to hoist the white-and-black banner again on a shorter flagpole.

Kabul expressed "serious displeasure" at the handling of the peace talks.

The US has long wanted the talks, but Kabul said there had been a "breach of principles" in the initiative.

The Afghan foreign ministry accused the Americans of acting in bad faith.

"The manner in which the office was established was in clear breach of the principles and terms of references agreed with us by the US government," the ministry said in a statement.

It added that the Taliban had been presenting the office as an embassy - a move that Kabul said it could not accept.

On Wednesday, US Secretary of State John Kerry told President Hamid Karzai that the flag, and the nameplate which included words "Islamic Emirate of Afghanistan", would be removed - measures rejected as insufficient by Afghan officials.

Fraught process

Correspondents say that the Qatar office, which was opened on Tuesday, means the Taliban are no longer only a fighting group but have a political arm too.

Analysis For the US and its allies, a major threshold has been passed: this week the Taliban reassured the world they did not want Afghanistan to be a base to attack anyone else. That is shorthand for saying they will not be coming back hand-in-hand with al-Qaeda. Some don't believe them, some see the Taliban as equally malign. But for the US, that has lost more than 2,000 servicemen and women to this conflict, a de-facto Taliban assurance that there will be no repeats of the 9/11 attacks planned from Afghan soil is a valuable prize. Can Taliban office row derail peace talks?

The dispute is just one indication of how fraught with difficulty this fledgling talks process will be.

The BBC's Aleem Maqbool, in Qatar, says the Taliban crave public legitimacy and they feel the opening of their office is a big success.

For its part, the Afghan government feels it did not get enough credit for its involvement in the talks process, our correspondent says.

On Wednesday Mr Karzai said Afghan negotiators would boycott the Qatar talks until "foreign powers" allowed the process to be run by Afghans.

He also suspended security talks with the US on the American presence in Afghanistan after Nato leaves in 2014.

The Afghan foreign ministry said in its statement on Thursday: "The Afghan government will never allow for an Afghan peace process to be hijacked by the enemies of Afghanistan for reaching their nefarious designs that they have failed to achieve on the battlefield of war in Afghanistan.

"If the Taliban office in Doha is brought back into compliance with the written assurances given to us by the US government, the Afghan government will review its decision about... negotiations with the US," it added.

In a separate development, a Taliban spokesman in Doha told the Associated Press news agency that the militants were ready to hand over a US soldier held captive since 2009 in exchange for five senior Taliban members held at the Guantanamo Bay prison.

Some Western officials, with barely concealed frustration, often dismiss what they see as a prickly paranoia. But in this latest upset, the president's anger seemed justified Q&A: Taliban's Doha office

The first formal meeting between US and Taliban representatives had been expected to take place in the coming days, but it is now unclear what role Afghan officials will play.

The US met the Taliban secretly in 2011 in Qatar, but these would be the first open talks.

The Taliban office opened on the same day that Nato handed over security for the whole of Afghanistan to the Afghan government for the first time since the Taliban were ousted in 2001.

This was something analysts said was necessary before talks could become a realistic possibility. But the Taliban have long insisted on the complete withdrawal of foreign forces as a pre-condition to becoming part of a political settlement.

Nato's combat troops are due to leave the country by the end of 2014, but the US plans to station a few thousand personnel there after that as part of a bilateral security agreement.

Details are still to be agreed by Kabul and Washington.