Image caption Mr Karzai feels his government is being excluded

The Afghan government will not take part in peace talks with the Taliban unless the process is "Afghan-led", President Hamid Karzai has said.

His statement came a day after the US agreed to talk to the Taliban in Qatar, where the militants have a new office.

Mr Karzai said the opening of the office contradicted earlier US security guarantees to his government.

In protest, he also said he would suspend talks on the US presence in Afghanistan after Nato leaves in 2014.

Earlier, four US soldiers died in a Taliban attack at an Afghan airbase, further undermining prospects for the proposed talks.

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

'Afghanised' talks

A statement from Mr Karzai's office said Afghan negotiators would stay away from the Qatar talks until "foreign powers" allowed the process to be run by Afghans.

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.

"Unless the peace process is 'Afghanised', the High Peace Council is not attending the Taliban Qatar talks," the statement said.

The High Peace Council (HPC) is the government body set up to lead peace efforts with the Taliban.

The fact that the Taliban opened its political office in the Qatari capital, Doha, on Tuesday was "totally contradictory to the guarantees that were made by the USA to Afghanistan," the statement added.

Sources close to President Karzai told the BBC's Bilal Sarwary, in Kabul, say that the Afghan government had been given written guarantees by the US that "the office will be used as an address for peace talks".

But instead, the sources said, Taliban representatives had talked about "bloodshed" and "killings" and had asserted the office had opened "to end the occupation of Afghanistan."

Image caption The row centres on a Taliban office which opened in Doha on Tuesday

"This is not peace, this is talking about war and destruction," the presidential sources said.

President Karzai's side also objected to the Taliban flag flying over the new premises, and the building's name: 'Islamic Emirate of Afghanistan'.

In interview with the BBC Pashto service, a Taliban spokesman in the Qatar office, Mohammad Naim, confirmed that ending the occupation of Afghanistan was the purpose of the office.

Preconditions

The opening of the Taliban office happened 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.

Media playback is unsupported on your device Media caption US President Barack Obama says he expected "friction" ahead of talks with the Taliban

According to the BBC's Paul Adams in Washington, the White House has demanded - and the Taliban accepted - two preconditions for the talks: that the Taliban make a statement supporting a peace process, and that it oppose the use of Afghan soil to threaten other countries.

A ceasefire is not part of the preliminary negotiations.

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

But the spokesman at the Taliban office, Mohammad Naim, said the constitution "was made during the occupation" and that "most Afghans do not accept this constitution".

President Obama said he always expected "friction" at the 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".

What Afghans think about Doha office 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 newspaper 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

'Puppets of Washington'

The first formal meeting between US and Taliban representatives is expected to take place in Doha on Thursday.

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

President Karzai had initially said he intended to send HPC delegates to engage in the talks too.

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

But on Tuesday the insurgents said they would meet Afghans, suggesting they might be prepared to meet HPC negotiators - that is, of course, if the HPC representatives reverse their own decision and decide to go.

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.

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.