A suicide bomber tried to assassinate a prominent female member of Afghanistan's parliament, killing three people and wounding the lawmaker, a senior official said.

Shukria Barakzai was slightly wounded in Sunday’s attack on her vehicle as she was heading to parliament, interior ministry spokesman, Sediq Sediqqi, said.

Another three people, including a young girl, were killed, while at least 17 others were injured, he said.

The attacker was in a car that attempted to ram Barakzai's vehicle. The assailant then detonated explosives, causing a massive blast that was heard across the capital, Sediqqi said.

Interior Minister Mohammad Umar Daudzai visited Barakzai at the hospital, Sediqqi said, adding that her driver was also wounded and hospitalised.

Barakzai, 42, is a high-profile advocate of women's rights and media freedom. She has been a member of parliament for 10 years and her work has been recognised internationally with a number of awards.

She has spoken about receiving regular death threats.

Shinkay Karokhil, another female MP, told the AFP news agency: "The target was a convoy of MPs who were driving toward the parliament. Shukria Barekzai was affected by the attack but she is fine."

Afghanistan is grappling with a vicious insurgency led by the Taliban, who last week made a similar assassination attempt against Kabul's chief of police Gen. Mohammad Zahir Zahir.

The attack came the day after President Ashraf Ghani ended a two-day visit to neighbouring Pakistan, which is blamed for sheltering Taliban leaders.

Ghani, a supporter of better women's rights, said improved relations with Pakistan could aid security in the troubled region as US-led NATO combat troops leave Afghanistan after more than a decade of fighting the Taliban.