The attack hit close to the outer perimeter of Kabul airport, which was targeted last week when insurgents seized a building in the same area and fired towards the airport using automatic weapons and rocket-propelled grenades.
The Taliban opposes the election process, which is currently undergoing an audit of all eight million votes due to a dispute between the two contenders over fraud allegations.
"Our initial reports show the explosion took place inside the foreigners' compound -- four foreigners were killed and six were wounded," Kabul police chief Zahir Zahir told AFP. "The foreigners were exercising inside at the time."
The nationalities and jobs of the victims was not known, and there was no immediate comment from NATO's International Security Assistance Force (ISAF), which is winding down its mission after a 13-year war against the Taliban.
More From This Section
"The attack happened inside a joint compound used by the counter narcotics department (of the interior ministry) and foreign forces," Hashmat Stanakzai, spokesman for Kabul police said.
"Also at around 7:00 am, another bomb exploded (in the same district) slightly wounding one civilian."
Another government official told AFP that the victims worked for a private contractor.
Afghanistan is on edge as the election dispute between poll rivals Ashraf Ghani and Abdullah Abdullah threatens to trigger instability and revive ethnic tensions that ravaged the country during the 1992-1996 civil war.
NATO combat troops will withdraw from Afghanistan by December, and reports suggest unrest is already worsening nationwide.
Civilian casualties soared by 24 percent in the first half of 2014, according to recent UN figures, while the International Crisis Group (ICG) has said the "overall trend is one of escalating violence and insurgent attacks".