The factory building had been expanded illegally, with additional floors stacked one on top of another. An engineer had declared it unsafe, and the thousands of people who worked inside, stitching garments for clothing brands from around the world, knew it was trouble.
"That factory was very risky," said Khadiza Begum, who was working at Rana Plaza the day the complex collapsed, five years ago Tuesday."It had weak pillars, it had narrow stairwells, it had no fire exits."
"We saw cracks in the building before it collapsed on us," she said.
The tragedy killed 1,134 people, many of them young women supporting extended families, and injured more than 2,500. It focused international attention on Bangladesh's role as the world's second-largest garment producer, and led the government and manufacturing associations to promise big improvements.
Many of the world's top clothing brands said they would stop contracting with factories if they failed to improve safety for their workers.
Five years later, the situation is complicated, according to a recent study conducted by the Center for Business and Human Rights at New York University's Stern School of Business.
"We have found tremendous improvement in the larger factories," that have signed onto two major safety programs organized by foreign brands, Paul Barrett, deputy director of the center, said in an email. "But two other categories — factories overseen by the government and subcontracting facilities not overseen by anyone — remain at risk."
The center's survey of conditions at Bangladesh's textile factories, found that workers at about 3,000 of the country's 7,000 factories are still exposed to life-threatening risks, ranging from a lack of fire safety equipment to serious structural flaws. The dangerous factories are often small, but sometimes subcontract work from larger factories that deal with foreign brands.
Those factories rarely allow access for journalists, though the best-equipped factories are eager to show off their workplaces.
S.M. Khaled is the managing director of the Snowtex Outerwear Ltd. Factory, a $42 million complex built after the 2013 disaster in the industrial suburb of Dhamrai, outside the capital Dhaka.
"The collapse of Rana Plaza was a wake-up call for us — for the industry and for the buyers," he said as he walked through the factory. "Look at my factory. Look around. I have done my best to keep it safe for the workers."
"We have invested a lot to keep my factories safe and compliant," he said.
Snowtex, which does business with some of the world's top brands, has about 8,000 workers in its five story factory, each floor spread over 52,000 square feet. The factory has wide stairwells, emergency exits, fire safety equipment, sprinklers and first-aid equipment on hand. Workers have been trained in fire safety and rescue techniques and the factory runs regular fire drills. It's just a few kilometers (miles) from where Rana Plaza stood.
All that is a relief to Begum, who was trapped for hours after the Rana Plaza collapse. She was so shaken by the experience she didn't work for two years.
"I took a job at a garment factory, but after one or two days there I had the feeling that the floor was shaking, or the building would fall down. I was afraid, and after one or two days I couldn't work anymore," she said.
Eventually, with her family desperately needing money, she got a job at Snowtex.
"It's very different here," she said, sitting in front of a sewing machine. "This building is good and strong."
Textile exports are a huge business for Bangladesh, bringing in $28 billion annually, mostly from to Europe and the United States.
Many of the improvements after the Rana Plaza collapse were brought on with pressure from two safety programs organized by foreign textile brands: The Accord on Fire and Building Safety in Bangladesh, organized by European brands, and the Alliance for Bangladesh Worker safety, which was backed by North American retailers. Under the programs, some 2,300 factories have been inspected and many have upgraded their safety standards.
Industry insiders guardedly admit that subcontracting remains an issue in the garment industry, with larger businesses sometimes contracting some work to smaller, less-safe factories. They insist those deals are being phased out.
Khaled said the established factories know they are being monitored by the international brands, and don't want to get in trouble by subcontracting.
"This is no longer a major concern like it was before," he said, adding that many smaller factories only produce clothes for local markets.
But Barrett disagrees.
"Subcontractors do exist and play an important role in the industry," he said in an email. "Denial has consequences."
Worker safety should not depend on where the clothing is being worn, Roy Ramesh Chandra, president of Bangladesh's United Federation of Garment Workers, said in an interview.
"Authorities need to address all the factories — whether it is producing for export" or for Bangladeshis.