The security guard was injured in the incident at the Cure International hospital and detained by police, officials said, adding that the motive behind the shootings was not immediately known.
"As a result of shooting by a security guard of the Cure hospital... Three foreign nationals have been killed and one female medical staff injured," a statement from the interior ministry said.
"The incident happened at around 9:50 this morning and the attacker has been injured and detained by police. The motive behind this attack is not clear yet."
It operates hospitals in 29 countries, and specialises in treating children with conditions including clubfoot, cleft lips, burn injuries and brain diseases.
Also Read
A doctor who was treating the wounded at the hospital in west Kabul confirmed the incident and said a foreign doctor was among the dead.
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.
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.
There was no immediate comment from Taliban spokesmen on today's hospital attack.
Preliminary results from the April 5 election are due to be released on Saturday, with former foreign minister Abdullah Abdullah ahead of his main rival Ashraf Ghani after half of the ballots were counted.