Eight people died when chemicals used for firefighting were accidentally released inside a building in Thai capital Bangkok on Sunday.

Workers were reportedly testing improvements to the fire prevention systems at the Siam Commercial Bank headquarters on Sunday night when they accidentally sucked oxygen from the building by releasing the fire retardant.

Seven people were injured in the incident, Thai police said.

The Siam Commercial Bank said it was "an accident caused by the negligence of the contractor hired to improve fire protection of the building," Bangkok Post reported.

Thick smoke emerged out of the basement of the bank's head office on Ratchadaphisek Road but rescue personnel could not save those trapped inside in time as the rooms were locked up in bank grade security.

The fire agents accidentally released contained Pyrogen, which extinguishes a blaze by decreasing oxygen levels.

"The fire protection system's duty is to release a type of gas that causes the insufficiency of oxygen, which will prevent fire outbreaks from flaring," Vichit Suraphongchai, chairman of the executive committee of SCB, said.

"But in this incident, there is people inside and lacks oxygen, so people suffocated, resulting in deaths and injuries. Therefore the incident is not caused by a fire or any explosion," he added.