Karachi - Two guards and a policeman on duty were killed by the attackers.
Separatist insurgents from Balochistan province - the Baloch Liberation Army (BLA) - claimed responsibility in a post on Twitter but Reuters was not able to verify the authenticity of the claim and spokesmen for the group were not available for comment.
"We locked ourselves in our offices," Asad Javed, who works at a brokerage in the stock exchange building, which is in a high security zone that also houses the head offices of several banks, told Reuters.
For now firing has stopped and reinforcement are in place.
(2/2)#PSX
- PSX (@pakstockexgltd) June 29, 2020
Javed said he was on the ground floor when he heard gunfire and an explosion and people scattered for safety.
The police chief in Pakistan's biggest city and financial hub, Ghulam Nabi Memon, told Reuters the gunmen attacked with grenades and guns after pulling up in a silver Corolla car.
They threw a grenade at security men posted outside the compound then opened fire on a security post. The four were killed when security forces posted there responded.
- Imran Ismail (@ImranIsmailPTI) June 29, 2020
Their car was abandoned where they left it.
Two guards and a policeman were killed and seven people were wounded, Deputy Inspector General of Police Sharjil Kharal told media.
A counter-terrorism official told Reuters the attackers were carrying significant quantities of ammunition and grenades in backpacks.
The BLA claimed responsibility in a brief message on a Twitter account set up shortly before the raid, describing it as a "self-sacrificing" attack carried out by its Majeed brigade.
The account was suspended a short time after the attack.