"The attack in Afghanistan's Parwan province killed 26 people, 42 were injured," Nasrat Rahimi said, adding that women and children were among the victims.
An aide to Afgan President Ashraf Ghani told Reuters that the president wasn't injured in the attack.
According to a security source, the explosion was caused by a magnetic bomb planted on a car.
At the same time, another blast has been reported in Kabul's police district 9 (PD9) near Ahmad Shah Massoud square.
No casualties or injuries were reported, according to Nusrat Rahimi, a spokesman for the Afghan Interior Ministry.
Afghanistan's independent election commission announced in March that the presidential election would be held on 28 September 2019. The Taliban, which has been fighting a long-running insurgency in the country, threatened to undermine the vote. UN General Secretary's envoy expressed his concern that the Taliban could target civilians taking part in the election.
There are 18 candidates for the post of president, including Ashraf Ghani and Abdullah Abdullah, who were major rivals in the 2014 vote.
Last week, US President Donald Trump cancelled secret talks with Afghan President Ashraf Ghani and Taliban leaders at the Camp David presidential retreat following a car bomb attack in Kabul, in which a US soldier was killed. Commenting on the issue, Trump said that talks with the Taliban aimed at ending the 18-year war in Afghanistan were "dead".