Afghanistan's president said on Sunday that the US must no longer carry out military operations or air strikes and must jump-start peace talks with the Taliban, before his country will sign a security deal to keep American troops in the country after 2014.

President Hamid Karzai's statement came as the Taliban intensifies assaults ahead of the planned withdrawal. On Friday militants targeted a popular Kabul restaurant in the deadliest single attack against foreign civilians in the nearly 13-year US-led war.

On Sunday hundreds of Afghans gathered outside the Lebanese restaurant, Taverna du Liban, to protest against the assault that killed 21 people. A suicide bomber and two gunmen attacked, killing 13 foreigners, including two Americans, and eight Afghans, all of them civilians. Protesters chanted against terrorism as they laid flowers.

"Today, we stand against terrorist attacks in Afghanistan, and the killing of the civilians by terrorists," said one demonstrator, Salma Alkozai.

Although Karzai has made similar demands in the past, he has recently ratcheted up his condemnations of alleged US failures as Afghans look to an uncertain future. Karzai made Sunday's statement after being presented with the findings of an investigation into a joint Afghan-US military operation last week that resulted in civilian casualties which he blamed on a US military air strike.

The US-led international military coalition, however, provided a sharply different account of what happened during the two-day operation against insurgents in eastern Parwan province, saying it was an Afghan-led effort and carried out at the request of the government.

Karzai convened his National Security Council on Sunday to discuss the Parwan attack. A statement said: “Air strikes are a matter of concern for the Afghan people. The National Security Council said there should be an immediate end to all operations and air strikes by foreign forces.”

Karzai sent a delegation to investigate the 15 January air strike in the Ghorband district of Parwan province, which borders Kabul. The delegation blamed the US for ordering an operation it said killed 12 civilians and four Taliban fighters. It further said local authorities were not informed about the operation. The coalition, which is carrying out its own investigation, said the government was not only aware but had requested the operation ahead of the country's 5 April presidential elections, because the area had fallen under Taliban control.

A coalition statement said: “The operation was requested by the governor in response to those conditions. The resulting plan, approved through the Ministry of Defence, was a deliberate clearing operation to disrupt insurgent activity, based on intelligence obtained primarily by Afghan forces.”

The coalition said a team of more than 70 Afghan commandos with a few US Special Operations Forces carried out the operation. Senior US military officials, who requested anonymity as they were not allowed to brief journalists about an ongoing investigation, said the commandos came under heavy fire almost immediately. An Afghan commando and a US soldier were killed, they said.

Afghan national security forces had nine US advisers with them when they became trapped by withering fire from residential homes, the officials said.

The coalition statement said: “At that point, the ANSF and coalition advisers were unable to manoeuvre or withdraw without sustaining significant casualties. The combined force required defensive air support in order to suppress enemy fire from two compounds."

One senior US military official said the decision to ask for air support was taken "in extremis" by the Afghan ground commander. The official said two civilians were killed and one wounded.

Karzai has declined to sign an agreement allowing some US forces to stay past the planned withdrawal. The president tentatively endorsed the deal after it was completed last October, but first refused to sign it until after it was approved by a council of tribal elders, known as the Loya Jirga, in November. After the elders approved it, Karzai still declined to sign it, now saying he wanted his successor to decide after the elections.

The US had wanted the deal to be signed by 31 December, because it needs time to prepare to keep thousands of US troops in the country for up to a decade. Nato allies have said they will not stay if the Americans pull out.

The agreement aims to help train and develop Afghan forces, while allowing for a smaller counterterrorism force to pursue al-Qaida fighters and other groups.

Karzai again demanded on Sunday that the US do more to start talks with the Taliban, although an American effort to get them going through intermediaries in Qatar collapsed last summer. The Taliban have refused to talk directly with Karzai, his government or its representatives.

Karzai's statement further warned that the country risked slipping into "feudalism" if his conditions were not met.