KABUL, April 24 (Reuters) - Three foreigners were killed on Thursday when a security guard opened fire at an international hospital in the Afghan capital, Kabul, security sources said, in the latest of a series of attacks against foreign civilians.

Attacks on security forces, Afghan civilians and Westerners have been on the rise since the beginning of the year as Afghans have voted for a successor to President Hamid Karzai, barred by the constitution from running again.

"Unfortunately, we have an incident in which three foreign nationals were killed by a security guard and one medic has been wounded," an Interior Ministry official told Reuters.

"The shooter is wounded and is in police custody."

No further details were available.

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

The hospital in the west of the city confirmed the attack, but provided no further details.

"The security and national police are here in the hospital, but we cannot provide any information about the attack. We are locked in the office," a hospital official said.

This month, Associated Press photographer Anja Niedringhaus, 48, was killed and reporter Kathy Gannon, 60, wounded while they were sitting in the back of a car in the east of the country.

The assault on the journalists came just weeks after an Afghan journalist with the Agence France-Presse news agency was killed alongside eight other people when Taliban gunmen opened fire inside a luxury hotel in the centre of Kabul.