Three Americans were killed on Thursday when a security guard opened fire at a Kabul hospital funded by a U.S. Christian charity, the latest in a spate of attacks on foreign civilians in Afghanistan.

Attacks on security forces, Afghan civilians and Westerners have been on the rise since the beginning of the year as Western forces prepare to leave the country and Afghans choose a new president.

"We can confirm three Americans were killed," said a U.S. Embassy official, without providing further details. A fourth American was wounded, the Afghan Health Ministry said.

The attacker, a policeman employed as a security guard at the Cure Hospital, was captured, the ministry said. The Taliban have claimed responsibility for similar attacks this year, but made no comment about Thursday's shooting.

Those killed included a doctor, and a father and son visiting the hospital, Health Minister Suriya Dalil said.

"As they were walking out of the hospital, the security guard opened fire on them, killing three and wounding another one," an Interior Ministry official said.

The security guard shot himself after the attack and was treated at the hospital before being transferred to Afghan custody, Mark Knecht, chief financial officer of Cure International, said in a televised statement.

Knecht said two other people were injured, but did not elaborate.

'Inhumane and brutal"

The shooting occurred in the grounds of the Cure Hospital which specializes in children's and maternal health. It is considered one of the country's leading hospitals as well as being a training institution.

"They were not the people carrying guns, they did not have military uniforms, they came here under immense pressure and were here only to serve the people of Afghanistan," Dalil said.

"This was an inhumane and brutal action, and unfortunately will impact our heath services."

The Cure organization began operating the hospital in 2005, at the invitation of the Afghan government, and 27 doctors and 64 nurses work there, according to Cure's website.

In January, a Taliban attack on a popular Kabul restaurant with suicide bombers and gunmen killed more than a dozen people, while in March gunmen slipped past security at an upscale hotel in the Afghan capital and killed several diners in its restaurant.

The hospital shooting is also the second "insider attack" by a member of Afghan security forces targeting foreign civilians this month.

On April 4, an Afghan police officer shot two Associated Press staff working in the eastern province of Khost, killing photographer Anja Niedringhaus and wounding veteran correspondent Kathy Gannon.

With files from The Associated Press