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. Employees inside holed up in locked rooms or were evacuated out a back entrance.
"Our security forces fought and thwarted a huge tragedy which was planned by our neighbouring country India", Mr Khan told parliament, without offering any evidence.
Militants from the Baloch Liberation Army say they were behind the attack.
The BLA along with other militant outfits have always been fighting for secession of the southwestern Balochistan province, which they claim was forcibly incorporated into Pakistan when it was founded in 1947.
However, the situation has largely stabilised in recent years following operations by security agencies against armed political outfits.
"Prime Minister of Pakistan Imran Khan condemns the terrorist attack on the Karachi Stock Exchange".
The attackers launched the attack at the main gate before storming the building, Geo TV reported. "Their only aim was to take people hostage in the stock exchange", said Khan in the National Assembly on Tuesday.
Images from the scene show the bodies of a number of men on the ground next to large amounts of ammunition and weapons.
"When we opened our markets and economy, it is only then that others agreed that a smart lockdown is the only way to combat the pandemic", 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.
The insurgent Baloch Liberation Army group claimed responsibility for the attack. In November 2018, the group claimed responsibility for a raid on the Chinese consulate in Karachi that killed four people. All staff inside the building were unharmed.
India and Pakistan routinely exchange allegations of using militant groups to attack the other country.