Officers said militants surrounded the building and opened fire at the entrance in Karachi.
Two security guards and a policeman have been killed in the incident, which Pakistan police have declared a terrorist attack.
The four gunmen have now been shot dead by officers.
Inside the stock exchange, broker Yaqub Memon said he and others were huddled inside their offices.
The Karachi stock exchange is Pakistan's largest and oldest, incorporated today with the exchanges in Islamabad and Lahore.
Source : Afghan Voice Agency(AVA)