At least six people killed, including four Balochistan Liberation Army militants, police said, adding the gunmen were well equipped and possibly planned a long siege, which was quickly thwarted.
At least six people have been killed in an attack on the Pakistan Stock Exchange in Karachi's busy financial district.
Assailants opened fire and hurled a grenade near the entrance, police said, describing the attack which killed a police sub-inspector and two security guards, local media reported on Monday.
The four gunmen who attacked the exchange building were killed by security forces, police said, adding security forces were conducting a sweep for any remaining attackers.
Armed with grenades and automatic rifles, the assailants launched the attack around 0500 GMT, Dawn.com said.
Major attack averted
The Pakistan Stock Exchange did not suspend trading during the attack, Chief Executive Furrukh Khan said. Its main KSE-100 index dropped 220 points but it later recovered and was 200 points higher at 0830 GMT.
"We locked ourselves in our offices," Asad Javed, who works at a brokerage in the stock exchange building.
Javed said he was on the ground floor when he heard gunfire and an explosion and people scattered for safety.
"Clearance operation is under way in the stock exchange building and Pakistani authorities say their timely action has foiled a major terrorist attack there," journalist Kamran Yousaf told TRT World.
There was an attack on the PSX compound earlier today. The situation is still unfolding and management, with the help of security forces, is managing the security and controlling the situation.— PSX (@pakstockexgltd) June 29, 2020
The gunmen attacked the building, which is in a high-security zone that also houses the head offices of many private banks, with grenades and guns, said Ghulam Nabi Memon, chief of police in Pakistan's biggest city and its financial hub.
The gunmen initially threw a grenade at security men posted outside the stock exchange compound then opened fire on a security post.
The four were killed when security forces posted there responded.
Pakistan has long been plagued by militant violence but attacks have become less frequent in recent years after military operations against various factions in strongholds along the Afghan border.
Attackers came with backpacks full of weapons
A Counter-Terrorism Department official said the attackers were carrying significant quantities of ammunition and grenades in backpacks.
Rizwan Ahmed, a police official at the scene, said that after the attack was over, food supplies were found on the bodies of the gunmen, indicating they may have planned a long siege, which the police quickly thwarted.
Inside the stock exchange, broker Yaqub Memon said he and others were huddled inside their offices while the attack was underway.
When the firing ended, police gathered all the employees and brokers in a single room as forces conducted a security sweep of each floor of the building to ensure that no explosives had been left behind, he said.
Shazia Jehan, a police spokesman, said the bomb disposal team was also called to the stock exchange to clear the building of any explosive devices.
BLA terror group claims responsibility
Later, the Balochistan Liberation Army (BLA), a designated terror group, claimed responsibility for the attack.
The BLA, which Pakistan says has found safe across the border in Afghanistan, has carried out a series of attacks in Karachi in recent years, including an attack on the Chinese Consulate in November 2018 that killed two people.
Several projects linked to China's Belt and Road initiative are in Balochistan and are opposed by the BLA.
The Arabian Sea port of Gwadar is located in Balochistan and is part of China's multi-billion-dollar one-road project linking south and Central Asia to China.