Afghanistan on Friday acknowledged that an overnight attack by Taliban insurgents on a high-profile luxury hotel near the presidential palace in Kabul claimed the lives of nine civilians, including at least four expatriates.

Authorities initially said that four teenage gunmen were killed in the attack, and it took at least seven hours for officials to acknowledge that the toll also included the nine civilians. The late-evening raid on the Serena Hotel, largely used by visiting foreign dignitaries and diplomats, highlighted the militants’ ability to penetrate and conduct strikes in an area regarded as the most secure oasis in Kabul.

The U.S. Embassy said an American-Bangladeshi dual national was among those killed in the hotel attack. Afghan officials issued conflicting statements about the nationalities of the victims. The Canadian government said two Canadians were killed.

Three Afghan children between 2 and 5 years old were shot point-blank in the head, the Reuters news agency reported. The Afghan victims included Sardar Ahmad, 40, a journalist for the Agence France-Presse news agency, along with his wife and two daughters, Ahmad’s brother Turaj said by telephone. Ahmad’s young son was shot in the head, chest and leg and was reported to be in critical condition.

The attack on the Serena shocked many Afghans and foreigners. It followed an assault in January that killed 21 guests, 13 of them foreigners, in a Lebanese restaurant in Kabul’s diplomatic enclave.

In the Serena attack, Afghan officials said they were stunned by how the four assailants managed to get their weapons — small pistols hidden in their shoes and socks — past a gantlet of three separate lines of hotel security, including body searches and screening machines. Afghan authorities said they were investigating to determine whether hotel guards had any hand in the attack.

A Taliban spokesman, Zabiullah Mujahid, said in an e-mail that his group was behind the attack. The Taliban had information that nationals of “occupying countries,” as well as Afghan government officials and some “corrupt” lawmakers, were at the hotel to celebrate the Afghan new year, he said.

In a statement released by the presidential palace, President Hamid Karzai said that “this admissible and inhumane act is the work of the enemies of the Afghan people who do not want security and lasting stability in our country.’’

An Interior Ministry spokesman, Sediq Sediqqi, said the attack on the hotel, following the restaurant attack and the killing last week of a foreign journalist, represented a “new trend.” He said the strikes were part of an effort to sabotage the country’s April 5 presidential election, which the Taliban has vowed to derail.

Sediqqi said the attackers entered the Serena disguised as guests, then later opened fire on diners at the hotel restaurant.

With Karzai preparing to step down at the end of his second term, the upcoming presidential vote is seen as a key point in Afghan history because it could result in the country’s first peaceful transition of power.