Afghan President Hamid Karzai says he will refuse peace talks with the Taliban in a new office in Qatar unless only Afghans are involved and violence stops, after the militant group claimed responsibility for an attack that killed four American troops.

On Tuesday, after months of delays, the Taliban opened an office in Doha, Qatar, where representatives from the U.S. and the Taliban will hold peace talks on Thursday, senior U.S. administration officials and a Taliban spokesman said.

Karzai's High Peace Council was expected to follow up with its own talks a few days later, but it is now unclear whether or not those talks will happen.

Karzai is making the moves to protest the way the U.S. is reaching out to the Taliban in efforts to find a political solution to the war.

Karzai said his High Peace Council would "neither attend nor participate in the talks" until the process is "completely" in the hands of Afghans, according to a statement from his office.

More On This...

He changed his mind after objecting to the way the office announcement was handled, in particular the Taliban's use of its formal name "Islamic Emirate of Afghanistan."

In an attempt at damage control, Qatar's Foreign Ministry said late Wednesday that the Taliban had violated an agreement with them to call the office the "Political Bureau of the Taliban Afghan in Doha." It was not clear from the official Qatar News Agency report, however, if the Taliban would be forced to change the name.

Shafiullah Nooristani, a member of the High Peace Council, told The Associated Press that the use of the name violated agreements Karzai's government had made with the U.S. and caused diplomatic issues for Afghanistan.

"The agreement was that the office should open only -- and only -- for negotiations, not as a political entity like a parallel institution to the Afghan Embassy, which is already there," Nooristan said.

Karzai also suspended negotiations on a new U.S.-Afghan security deal that would allow some American troops to remain in the country after the international combat mission ends in 2014 to protest the fact that his government was being left out of the initial Taliban peace talks process.

The statements came despite an olive branch from President Barack Obama to Karzai, with Obama telling reporters during a visit to Berlin Wednesday that "ultimately we're going to need to see Afghans talking to Afghans."

Obama said later the U.S. had anticipated "there were going to be some areas of friction, to put it mildly, in getting this thing off the ground. That's not surprising. They've been fighting there for a long time" and mistrust is rampant. Obama said it was important to pursue a parallel track toward reconciliation even as the fighting continues, and it would be up to the Afghan people whether that effort ultimately bears fruit.

Karzai's spokesman was not immediately reachable Wednesday for questions, and the U.S. Embassy in Kabul said it had no immediate comment.

Nooristan, however, is holding out hope that the Qatar talks would still be possible.

"We are working to solve these contradictions and fix these problems and act based on the agreements we had before so the High Peace Council can go there and start the peace talks," he said.

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.

In another incident highlighting the fragile situation in Afghanistan, only hours after announcing they would hold talks with the U.S., the Taliban claimed responsibility Wednesday for an attack on the Bagram Air Base in which four American troops were killed.

Taliban spokesman Zabiullah Mujahid said the insurgents fired two rockets into the base outside the Afghan capital, Kabul, late on Tuesday. American officials confirmed the base had come under attack by indirect fire -- likely a mortar or rocket -- and that four U.S. troops were killed.

Also Tuesday, five Afghan police officers were killed at a security outpost in Helmand province by five of their comrades, officials said, the latest in a string of so-called "insider attacks" that have shaken the confidence of the nascent Afghan security forces. Local official Mohammad Fahim Mosazai said the five officers had only been on the local force for three months. He blamed the killings on Taliban infiltrators, saying the gunmen escaped with the victims' weapons.

The Associated Press contributed to this report.