Officials said they did not know the identity of the victims or the motive behind the attack, which comes amid rising violence in Afghanistan and less than a week after a woman British aid worker was killed in another part of Kabul.
The gunmen opened fire on a vehicle outside an office of the courier company DHL in the upmarket Sher Pur area of Kabul where many foreigners live.
One police official said one foreigner was killed in the attack, but a second police official said he had received conflicting reports that either one or two foreigners had been killed. Private television station Tolo TV said two foreigners were killed.
The second police officer said the victims worked for DHL.
Police at the scene covered the silver sports utility vehicle with plastic sheeting. There was blood on the ground and two bullet holes in the window of the DHL office.