Nizamani arrived in Kabul last month to take up the role at one of the few embassies that had remained operational throughout the period after the Taliban took over the country in August 2021.

Pakistan Prime Minister Shehbaz Sharif called the attack an "assassination attempt" while seeking an investigation and action against the perpetrators in a Twitter post.

A spokesperson for the Taliban's ministry of foreign affairs condemned the attack.

"Islamic Emirate of Afghanistan strongly condemns the attempted shooting and failed attack on the Pakistani embassy in Kabul," said spokesperson Abdul Qahar Balkhi on Twitter.

Meanwhile, two people were injured in another attack in Kabul on Friday afternoon near the office of the Hezb-e-Islami party associated with former Afghan prime minister Gulbuddin Hekmatyar.

It was not immediately clear who was behind both attacks, which come just days after Pakistan's Minister of State for foreign affairs led a team to Kabul to meet Taliban authorities to ease tensions along the border between the two countries.

The attack took place at a time of heightened security concerns in areas bordering Afghanistan after the Pakistani Taliban (TTP) said on Monday it would no longer abide by a months-long ceasefire with Pakistan government.

The Afghan Taliban have been facilitating peace talks between local militants and Pakistan authorities since late last year.

Several attacks have taken place in recent months, mostly on civilian and Taliban administration targets.

In September, two Russian embassy staff in Kabul were among six people killed when a suicide bomber detonated explosives near the entrance of the embassy in an attack claimed by IS.

(Reporting by Shivam Patel in New Delhi and Charlotte Greenfield in Kabul; Editing by Arun Koyyur)