The Pakistan Foreign Ministry said in a statement that the compound of Pakistan embassy in Kabul "came under attack today targeting head of mission, Ubaid ur Rehman Nizamani."
According to the statement, Nizamani is safe but a Pakistani security guard has been critically wounded.
The statement condemned the attack and called on the "interim Afghan government to immediately investigate the attack and apprehend the culprits."
A spokesman for the Ministry of Foreign Affairs, Abdul Qahar Balkhi, said on Twitter that the Islamic Emirate "strongly condemns failed firing attack towards Pakistan embassy in Kabul and prays for speedy recovery of a security guard."
Balkhi vowed that the Islamic Emirate will not allow "any malicious actors to pose a threat to the security of diplomatic missions in Kabul."
The attack was also condemned by Pakistan Prime Minister Shahbaz Sharif.
"I strongly condemn dastardly assassination attempt on Pakistan Head of Mission, Kabul. Salute to brave security guard, who took bullet to save his life. Prayers for the swift recovery of security guard."
"I demand immediate investigation & action against perpetrators of this heinous act," said Pakistan's prime minister on Twitter.
The UN Assistance Mission in Afghanistan said on Twitter it "strongly" condemns today’s attack on the Embassy of Pakistan in Kabul.
"Diplomatic missions are protected under international law," UNAMA said.