Paramilitary soldiers gather outside the Afghan consulate, after an Afghan diplomat was shot dead on Monday in the consulate in Karachi, Pakistan Feb. 6, 2017. Reuters

An Afghan diplomat was shot and killed in Pakistan during a personal dispute with his security guard inside of the Afghan consulate in the southern port city of Karachi. The diplomat, Mohammad Zaki Abdu, who served as the consulate’s third secretary, died after being shot several times from the guard’s automatic weapon in the building’s lobby.

The security guard, who was identified as an Afghan national named Rahatulla Ullah, has been arrested. Police intervened immediately after hearing the shots, according to the consulate’s spokesperson, Haris Khan.

"We were working at our office when we heard gunshots," Khan told the Associated Press. "Everybody was running in panic."

Rahatulla was reportedly the deceased diplomat’s personal bodyguard.

Karachi is the largest city in Pakistan and a major business and industrial hub. The consulate is located in the city's well-heeled Clifton neighborhood, which also hosts the embassies of the United Kingdom and France.

Because of the history of violent incidents at the hands of Islamic extremists in Pakistan, foreign diplomats have been known to routinely hire additional security personnel while serving there. At least 500 people were killed in Pakistan from terror attacks since December 2014, according to a March 19, 2016 article in the New York Times. It remains unclear whether Rahatulla was ever officially hired by the Afghan Consulate.

“So far, from what we have gathered from the investigation, the killing seems to be the result of some sort of personal grudge between the guard and third secretary. We have found there was a history of tensions between the two persons," Deputy Inspector General of Police, Azad Khan, told Reuters Monday.

Noor Wali Khan Noor, a foreign ministry official in Kabul, told the Associated Press that a team of Afghan investigators would be deployed to Karachi for a comprehensive evaluation of the situation.

Pakistan's Foreign Secretary Aizaz Ahmad Chaudhry reached out to the Afghan ambassador on the phone to offer condolences and express that how his government was willing to provide any aid needed for the investigation, according to a statement from Pakistan's Foreign Office. Both sides have not revealed a motive for the killing.

Afghanistan and Pakistan have often accused each other of providing Islamic militants a safe haven to conduct their operations inside its borders.