DHAKA, Bangladesh — A building housing several factories making clothing for European and American consumers collapsed into a deadly heap on Wednesday, only five months after a horrific fire at a similar facility prompted leading multinational brands to pledge to work to improve safety in the country’s booming but poorly regulated garment industry.

By early Thursday, the Bangladeshi news media reported that at least 142 people died in the rubble of Rana Plaza, a building in Savar, an industrial suburb of Dhaka, the capital. Police officials put the death toll at 134, with more than 1,000 of 2,500 workers injured, many of them still trapped. Soldiers, paramilitary police officers, firefighters and other citizens clawed through the wreckage, searching for survivors and bodies.

Brig. Gen. Ali Ahmed Khan, head of the National Fire Service, said that an initial investigation found that the Rana Plaza building violated codes, with the four upper floors having been constructed illegally without permits.

“There was a structural fault as well,” General Khan added, noting that the building’s foundation was substandard.