An Afghan policeman opened fire at a Kabul hospital run by a US charity on Thursday, killing three Americans, including a doctor in the latest deadly attack targeting foreign civilians in the city. The gunman was injured in the incident outside the CURE International hospital and detained by police, officials said, adding that the motive for the shooting was not immediately known. "He opened fire as the foreign nationals were entering the hospital, tragically killing three and injuring one more," Seddiq Sediqqi, spokesman for the interior ministry, told AFP. "Another policeman in the area shot the attacker, injuring him." Health minister Soraya Dalil told reporters the victims were a US doctor who had worked for CURE for seven years and an American father and son visiting the hospital. She added that the attacker, who had been on duty guarding the hospital, was now being treated inside for his injuries. "With great sadness we confirm that three Americans were killed in the attack on CURE Hospital," the US embassy said on its Twitter account. "No other information will be released at this time." Kabul has been hit by a spate of attacks targeting foreign civilians this year, including a Lebanese restaurant where 21 people died, an attack on a luxury hotel and the daylight shooting of a Swedish radio journalist. Last month Taliban militants attacked a Kabul guesthouse used by Roots of Peace, a US anti-landmine charity, killing two people including a girl. And this month Associated Press (AP) photographer Anja Niedringhaus was shot dead by a police commander in the eastern province of Khost in an attack which also left her Canadian colleague Kathy Gannon badly wounded. That killing came on the eve of presidential elections to choose a successor to Hamid Karzai as US-led combat troops withdraw from Afghanistan after 13 years of fighting Taliban insurgents. - Testing times as US troops exit - CURE International is a non-profit organisation founded in 1998, based in Pennsylvania and working in 29 countries including conservative Muslim Afghanistan. It describes itself as an "unapologetically Christian organisation" on its website, but says that it offers "treatment regardless of gender, religion, ethnicity, or ability to pay". Its hospitals and health programmes specialise in treating children with conditions including clubfoot, cleft lips, burn injuries and brain diseases. CURE International took over the hospital in west Kabul in 2005 at the invitation of the Afghan government, and runs obstetrics, gynaecology, pathology and surgery departments as well as training schemes for doctors and nurses. There was no immediate comment from Taliban spokesmen after the hospital shooting. Preliminary results from the April 5 presidential election are due to be released on Saturday. After half of the ballots were counted, former foreign minister Abdullah Abdullah was ahead of his main rival Ashraf Ghani. The incoming president will have to impose security as 51,000 NATO combat troops pull out by the end of this year, as well as strengthening an economy reliant on declining aid money. Eight candidates ran in the election, with polling day hailed as a success by Afghan officials and foreign allies. Voters turned out in force and the Taliban failed to launch a major attack despite threats to disrupt the vote.