The top US general in Afghanistan has expressed dismay at remarks by President Hamid Karzai, who suggested that Washington benefited from Taliban attacks on his country.

Mr Karzai's remarks further strained already fraught ties between him and the Western allies who are fighting to protect his government from insurgents.

The US still has 66,000 troops in Afghanistan, down from almost 100,000 two years ago at the height of a surge ordered by President Barack Obama.

Washington intends to withdraw most of them by the end of next year but wants to negotiate a continued, smaller presence.

Speaking a day after two Taliban bomb attacks that killed 18 people, Mr Karzai said the bombings served Washington's aim of trying to convince Afghans that US forces were needed.

"Those bombs that went off in Kabul and Khost were not a show of force to America. They were in service of America. It was in the service of the 2014 slogan to warn us if they (Americans) are not here then Taliban will come," Mr Karzai said.

"In fact those bombs, set off yesterday in the name of the Taliban, were in the service of Americans to keep foreigners longer in Afghanistan," he said in a speech.

Mr Karzai's remarks drew a rebuke from General Joseph Dunford, the head of US and NATO forces in Afghanistan.

"We have fought too hard over the past 12 years, we have shed too much blood over the past 12 years, we have done too much to help the Afghan security forces grow over the last 12 years to ever think that violence or instability would be to our advantage," he told reporters.

Of Mr Karzai's remarks, he added: "I'll let others judge whether that's particularly helpful or not at the political level."

The issue of US troop levels after most US-led NATO combat troops withdraw by the end of 2014 will be one of the main subjects on the agenda at talks between Mr Karzai and Mr Hagel

A joint news conference that had been scheduled for them was cancelled because of security worries, a US official said.

Mr Karzai also said the Taliban and the US had been holding talks in the Gulf Arab state of Qatar on a "daily basis", further fuelling his suggestion that Washington and the militants were working at common purposes.

The militant group and Washington both denied they had resumed efforts on dialogue, which stalled a year ago.

The US government has said it is committed to political reconciliation involving talks with the Taliban, but progress would require agreement between the Afghan government and the insurgents.

"This is simply incorrect," said a US official, who declined to be identified, when asked about Mr Karzai's remarks about the talks.