An Afghan diplomat was shot dead on Monday by a security guard inside an Afghan consulate in Pakistan, in what was described as a personal dispute, according to police.

The security guard, also an Afghan national, opened fire on Mohammad Zaki Uro, a third political secretary based at the consulate in the southern city of Karachi, Hamid Hamdard, an Afghan diplomat at the embassy in Islamabad, told Al Jazeera.

"The guard, Rehmat Ullah, opened fire on a junior diplomat Mohammad Zaki Uro, killing him on the spot and wounding another consulate official," senior police official Azad Khan told the AFP news agency.

Security forces and a heavy police contingent surrounded the consulate immediately after the attack amid fears of a possible assault.

"There was nothing of the sort and it seems the guard had some sort of personal grudge with the diplomat," Khan said.

A local police official told the Reuters news agency that the guard "used his automatic weapon, firing multiple bullets".

Omar Zakhilwal, the Afghan ambassador to Pakistan, confirmed the shooting on his official Facebook account.

"Firing inside Afg Consulate General in Karachi at around 12:30 pm today ... has been carried out by an Afghan guard inside the compound resulting in fatality of one of our diplomats," Zakhilwal wrote.

The consulate is located in Karachi's upscale Clifton neighbourhood. The missions of Indonesia, Britain and France are nearby.