At least nine civilians including an Agence France-Presse reporter, children and foreigners were killed in a Taliban attack on a luxury hotel in Kabul, officials said Friday, just weeks before Afghanistan's presidential election. Four teenage gunmen with pistols hidden in their socks managed to penetrate several layers of security at the Serena hotel, a prestigious venue favoured by foreign visitors to the capital, on Thursday night. Sardar Ahmad, a 40-year-old journalist in AFP's Kabul bureau, was among those killed along with his wife and two of their three children. An AFP photographer identified the four bodies at a city hospital and said the family's youngest son was undergoing emergency treatment after being badly wounded in the attack. Ahmad joined AFP in 2003 and became the agency's senior reporter in Kabul. He covered all aspects of life, war and politics in his native Afghanistan for the international news agency. Afghan President Hamid Karzai said he was deeply saddened by Ahmad's death. "The killing of Sardar Ahmad, his wife and two children was a big crime and is heartbreaking and sorrowful," Karzai said in a statement. AFP chairman Emmanuel Hoog said the killing was "immensely painful and an enormous loss" for the agency. - 'Direct link' to election - He described Ahmad as a "dedicated and courageous journalist, a cornerstone of our team in Afghanistan who delivered, every day, exceptional coverage of the news in extremely difficult conditions". Ahmad's last feature for AFP, filed on Tuesday, was about a lion rescued by animal welfare officials from living on a rooftop in Kabul -- a follow-up to a story he himself broke last year. "Sardar was not only among the very finest journalists in Afghanistan, but also a wonderfully optimistic and engaging personality," AFP editor-in-chief Phil Chetwynd said. "He has been the pillar of our bureau for the past decade and a great friend to many AFP colleagues." The Serena attack was claimed by the Taliban, who have vowed a campaign of violence to disrupt the April 5 poll which will decide a successor to Karzai. Previous Afghan elections have been badly marred by violence as the Islamist militants displayed their opposition to the US-backed polls. Another bloodstained election would damage claims by donors that the expensive intervention in Afghanistan since 2001 has made progress in establishing a functioning state, as US-led NATO combat troops wind down their long deployment. "We believe that such attacks have a direct link to the upcoming elections, and the enemies try to stage such attacks to frustrate the people of Afghanistan about their future," interior ministry spokesman Sediq Sediqqi told a news conference. The attackers reached the hotel's restaurant around 8:30 pm (1600 GMT) and began firing indiscriminately at diners, Sediqqi said. Nine people were killed in the assault, five Afghans and four foreigners, he said, and the dead included four women and two children. One of the civilians killed in the attack was a former Paraguayan diplomat who was in Afghanistan as an election observer, Paraguay's Foreign Minister Eladio Loizaga said. Loizaga named him as Luis Maria Duarte, a lawyer who also worked for the United Nations. Canada's foreign ministry spokesman said two Canadians were among the victims, while the Afghan foreign ministry said the dead also included two Bangladeshis. The attack ended around 11:30 pm when Afghan security forces killed the last of the attackers, the spokesman said, adding that most of the hotel guests had been able to take shelter in special safe rooms. The attack occurred on the eve of Nawroz, the Persian New Year which is a major holiday in Afghanistan, and the hotel was hosting special celebrations. - Fears for future - The Serena, the most upmarket accommodation in Kabul, has been targeted by militants in the past, including a Taliban suicide attack in 2008 that left eight people dead. By upgrading its security, the hotel has continued to attract diplomats, foreign workers and Afghan businessmen to its two restaurants, coffee shop and gym complete with outdoor pool. Sediqqi pointed to a failure of hotel security, as the attackers were able to smuggle six handguns and ammunition inside. "We are investigating, but our initial conclusion is that a failure of the security structure of the hotel made the attack possible," he said. Such a brazen assault on the Serena, a supposedly secure building, will send further shockwaves through Kabul's already rattled expatriate community. It comes less than a fortnight after Swedish radio journalist Nils Horner was gunned down in central Kabul. It will also raise fears that independent foreign election monitors will be unable to do their job effectively -- heightening the risk of poll-rigging on April 5. Taliban leaders earlier this month urged their fighters to attack polling staff, officials, voters and security forces before the election.