A Taliban suicide car bomber has detonated explosives near to a compound for foreign security contractors in the Afghan capital, Kabul, officials said.

At least three civilians were killed and two others wounded, with no casualties among the security contractors, when the bomb exploded in Kabul's Police District Nine, interior ministry spokesperson Najid Danish told Al Jazeera.

The Taliban immediately claimed responsibility for the attack, which occurred during Saturday morning rush hour.

The attack comes days after General John Nicholson, the top US commander in Afghanistan, said that the security of the country would be "the main effort" for international forces helping Afghan security forces.

The Taliban and the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group have launched a series of deadly attacks across the country, killing at least 200 people in Kabul alone since the beginning of 2018, according to an Al Jazeera tally.

President Ashraf Ghani called for a ceasefire last month and also explored a possibility of the Taliban group becoming a political party, if they accept the peace deal unconditionally.

There was no official response from the Taliban to Ghani's invitation to talks. The Taliban, however, invited US officials to its political office in Qatar to discuss a "peaceful solution" to end the bloodshed in Afghanistan.

The group also said that departure of American troops from Afghanistan remains a precondition for the group's talks offer.

But James Mattis, the US defence secretary, said on Tuesday during an unannounced visit to Kabul that the elements of the Taliban are open to talks with the Afghan government.

In December, General John W Nicholson Jr of the US Army said his country would deploy more troops in an advisory role to Afghan forces in 2018, on top of the 14,000 American soldiers already stationed in the country.