Angered by the killing of 16 Afghan civilians by a US Army sergeant, Mr Karzai said foreign forces should leave villages and return to larger military bases to avoid more civilian deaths.

Mr Karzai’s demand injected fresh uncertainty into a western mission reeling from last month’s riots over the burning of Korans at a US base, the deaths of six UK troops in a roadside bombing last week, and the weekend murder spree.

Any move by the Afghan government to prevent foreign troops conducting missions in the countryside would in effect spell the end of Nato combat operations, since the vast majority of fighting takes place in rural districts.

Separately, the Taliban announced on Thursday that it was breaking off contacts with mediators due to “shaky, erratic and vague” US statements, dealing a blow to another pillar of the west’s strategy for winding down the war.

Mr Karzai delivered his surprise message to Leon Panetta, the US defence secretary, who flew to Kabul on Wednesday to try to repair the damage to relations done by the massacre, one of the worst atrocities committed by US forces in 10 years of war.

As a consequence of the murders, “international security forces have to be taken out of Afghan village outposts and return to bases”, Mr Karzai said in a statement.

Mr Karzai said the shootings were “cruel” and that Afghan forces were capable of providing security in rural areas “on their own”.

Afghan and western officials played down the likelihood that Mr Karzai would press for any immediate confinement of Nato troops to barracks.

“It’s a reaffirmation of a very important Afghan priority,” said Janan Mosazai, spokesman for the Afghan foreign ministry. “If we can bring forward the transition timetable because of the growing professionalism and capability and capacity of the Afghan army and police then we should do that.”

A western diplomat in Kabul said Mr Karzai may have made his statement to appease public anger at a string of Nato blunders rather than to signal a shift in policy.

“It may be as much an emotional as a rational response,” the diplomat said. “He’s partly playing to his domestic gallery.”

The US said it did not believe the Afghan leader was calling for an immediate withdrawal of Nato forces from rural areas.

“We believe that this statement reflects President Karzai’s strong interest in moving as quickly as possible to a fully independent and sovereign Afghanistan,” said George Little, a Pentagon spokesman.

Nevertheless, the tone of Mr Karzai’s latest remarks underscored the frequent divergences that bedevil the US-Afghan alliance and may further dent public confidence among war-weary allies.

Isaf, the Nato-led force in Afghanistan, has begun gradually handing security duties to Afghan forces before the planned end of its combat duties in 2014.

Isaf says that Afghanistan’s army and police is already taking the lead in securing half of the population. The transfer of some of the most dangerous parts of southern and eastern Afghanistan is due to start in the coming year.

Barack Obama, US president, and David Cameron, UK prime minister, emphasised in Washington this week that foreign troops intend to hand over primary responsibility for fighting the Taliban to Afghan forces by the middle of next year.

Nato troops will remain on hand to provide extra firepower where needed until the end of 2014, when the US focus will shift away from counterinsurgency and towards counter-terrorism missions by smaller numbers of special forces.

The Obama administration wants to sign a long-term security pact to allow US forces to stay in Afghanistan until 2024 before a Nato summit in Chicago in May. The talks have been bogged down for a year, but some progress has been made in the past week, raising US hopes a deal might still be possible before the meeting.

It was as western officials parsed the implications of Mr Karzai’s latest statements that the Taliban said it was breaking off contacts with US mediators to protest at Washington’s attempts to involve the Afghan government in the talks.

The movement said it wanted to confine discussions with US representatives to the issue of transferring prisoners held in Guantánamo Bay and opening a Taliban “office” in Qatar to facilitate dialogue.

Nigel Inkster, senior fellow at the International Institute for Strategic Studies in London, said the statement might be an attempt at Taliban brinkmanship rather than a sign the talks are dead. “At the moment the Taliban are feeling things are going more their way and are being far more exigent of the US,” he said. “Whether talks have broken down completely remains to be seen.”