The incident happened in the high-security Clifton area of the city.
According to police, the deceased has been identified as Zaki Addu an official of the consulate.
The DIG South said the guard, Rahataullah, who opened fire was also an Afghan national and had used a sub-machine gun. However, he was arrested.
According to security forces, the incident is suspected to be a result of personal enmity.
Roads around the consulate have been closed for traffic.
The police and Rangers personnel cordoned off the area when the fire shots were heard.