Image caption The row centres on the new Taliban office, which opened in Qatar's capital Doha on Tuesday

Afghanistan has suspended talks with the US to discuss the nature of US military presence after foreign troops withdraw in 2014.

A spokesman for President Hamid Karzai said the decision was taken over "contradictions" in the US proposal of direct talks with the Taliban.

Mr Karzai also ruled out talking to the Taliban until the peace process was "Afghan-led".

Earlier, four US soldiers died in a Taliban attack at an Afghan air base.

A spokesman for the Taliban said the militants had launched two rockets at Bagram airbase, the largest military base for US troops in Afghanistan.

The attack came just hours after the US announced it would open direct talks with the Taliban at their office in the Qatari capital, Doha.

A condition for the talks was for the Taliban to renounce violence. However, US President Barack Obama did not make a ceasefire part of the preliminary negotiations.

Analysis President Karzai clearly feels a sense of anger and betrayal over the way the US made that announcement. He thought there would be a commitment from the Taliban to engage with the Afghan government, to recognise the constitution and to renounce violence. None of those promises were made. Hopes that these talks with the Taliban will go very far must be fading fast. Without the involvement of the Afghan government there is no peace process. Already tense relations with the US and President Karzai have reached a new low with the suspension of the negotiations of the Bilateral Security Agreement. On top of that the Taliban have given no indication that the fighting will end - carrying out an attack on the US military base in Bagram within hours of what was supposed to be an "important first step" towards reconciliation.

The BBC's Jonathan Beale says the Afghan government clearly thinks that US preconditions should have included a commitment to talk to the Afghan government, to acknowledge the constitution of Afghanistan and to renounce violence.

Meanwhile, President Obama said he always expected "friction" at Afghan peace talks.

"My hope is that despite those challenges the process will proceed," he said during an official visit to Berlin on Wednesday.

"Ultimately we're going to need to see Afghans talking to Afghans about how they can move forward and end the cycle of violence so they can start actually building their country".

'Name and flag'

Afghanistan's National Security Council confirmed President Karzai had suspended the fourth round of the bilateral security agreement talks.

"There is a contradiction between what the US government says and what it does regarding Afghanistan peace talks," the president's spokesman Aimal Faizi said.

He added that the president disagreed with the name given to the new Taliban office opened on Tuesday in the Qatari capital, Doha.

"We oppose the title the 'Islamic Emirate of Afghanistan' because such a thing doesn't exist," Mr Faizi said.

"The US was aware of the president's stance."

Afghan officials said Mr Karzai also objected to the Taliban flag flying over the new premises.

The announcement comes a day after Nato handed over the security for the whole of the country to the Afghan government for the first time since the Taliban were ousted in 2001.

What Afghans think about the Taliban office in Doha MP Shekiba Hashemi : "This is being done without the people of Afghanistan being consulted. It is not only a matter of concern but also a clear violation of the constitution."

: "This is being done without the people of Afghanistan being consulted. It is not only a matter of concern but also a clear violation of the constitution." Political analyst Kamal Sadat : "We welcome the opening of the Qatar office. It is a step forward in the peace process."

: "We welcome the opening of the Qatar office. It is a step forward in the peace process." Independent candidate Hasht-e Sobh : "With the opening of an office in Qatar, the Taliban have appeared both in the military and political fields against the Afghan government."

: "With the opening of an office in Qatar, the Taliban have appeared both in the military and political fields against the Afghan government." National Front spokesman Faizollah Zaki: "The office cannot play the role of a kind of embassy. The inauguration of the office cannot be at the cost of the legitimacy of the current Afghan government." Q&A: Taliban opens Doha office

The BBC's Bilal Sarwary says President Karzai has been reluctant to sign a long-term agreement with the US amid fears it would undermine Afghan sovereignty - and how it might reflect on him during his remaining time in office.

'Puppets of Washington'

US officials told reporters on Tuesday that the first formal meeting between US and Taliban representatives was expected to take place in Doha on Thursday.

On the same day, President Karzai said he also intended to send delegates of Afghanistan's High Peace Council (HPC) to Doha to engage in talks with the Taliban in the coming days.

But there are now questions whether the HPC, set up specifically to deal with the Taliban, will still go to Doha, correspondents say.

In the past, the Taliban have always refused to meet President Karzai or his government, dismissing them as puppets of Washington.

Mr Karzai has expressed anger at previous US and Qatari efforts to kick-start the peace process without properly consulting his government, correspondents say.

There is also concern within the presidential palace that the Taliban will use the office in Qatar to raise funds.

The US has previously tried to negotiate with the Taliban, but never held direct talks.

In March 2012 the Taliban said it had suspended preliminary negotiations with Washington, citing US efforts to involve the Afghan government as a key stumbling block.

The Taliban set up a diplomatic presence in Qatar in January 2012 and US officials held preliminary discussions there.