Shoppers wait on line at the checkout counter to purchase goods at an H&M store, in Atlanta Dec. 12, 2012. Swedish fashion retailer H&M said Monday, May, 13, 2013, that it will sign up to a legally binding fire and building safety plan drawn up by unions in Bangladesh. (David Goldman/AP)

Some of the world’s largest retailers have agreed to a first-of-its-kind pact to improve safety at some of Bangladesh’s garment factories. The move comes as the nearly three-week search for victims of the worst garment-industry disaster in history ended Monday with the death toll at a staggering 1,127.

In addition, Bangladesh’s government agreed to allow garment workers to form unions without permission from factory owners. That decision came a day after it announced a plan to raise the minimum wage in the industry.

The collapse of the eight-story Rana Plaza factory building April 24 focused worldwide attention on hazardous conditions in the garment industry in Bangladesh, where workers sew low-cost clothing that ends up on store shelves around the world, including in the United States and Western Europe. The tragedy came months after a fire at another garment factory in Bangladesh killed 112 workers.

Swedish retailing giant H&M, the largest clothing buyer in Bangladesh, on Monday said it would sign a five-year, legally binding contract that calls for retailers to take on a greater role in ensuring that the garment factories in Bangladesh are safe. Within hours, C&A of the Netherlands, British retailers Tesco and Primark and Spain’s Inditex, owner of the Zara chain, followed with their own announcements.

The pact requires that the companies conduct independent safety inspections, make their reports on factory conditions public and cover the costs for needed repairs. It also calls for them to pay up to $500,000 annually toward the effort, to stop doing business with any factory that refuses to make safety upgrades and to allow workers and their unions to have a voice in factory safety.

“We can slowly but surely contribute to lasting changes,” Helena Hermersson, an H&M spokeswoman, said in a statement Monday.

The companies join two other retailers that signed the agreement last year: PVH, which makes clothes under the Calvin Klein, Tommy Hilfiger and Izod labels, and German retailer Tchibo. The agreement has since been expanded to five years from two.

Among the holdouts, Wal-Mart, the second-largest clothing buyer in Bangladesh, said through spokesman Kevin Gardner that it had nothing to announce Monday. And Gap, which had been close to signing the agreement last year, said Monday that the pact is “within reach,” but the company is concerned about possible legal liability.

The safety agreement was applauded by labor groups, who say it goes a long way toward improving working conditions in Bangladesh’s garment industry.

Based on the seven companies that plan to participate in the pact, between 500 and 1,000 of the 5,000 factories operated in Bangladesh will be covered, according to Scott Nova, executive director of the Worker Rights Consortium, a workers’ rights group that had been one of the organizations pushing for the agreement.

“This agreement is exactly what is needed to finally bring an end to the epidemic of fire and building disasters that have taken so many lives in the garment industry in Bangladesh,” he said.

Since 2005, at least 1,800 workers have been killed in the Bangladeshi garment industry in factory fires and building collapses, according to research by the International Labor Rights Forum, an advocacy group.

After the latest tragedy, Walt Disney said it is stopping production of its branded goods in Bangladesh. But most retailers have vowed to stay and promised to push for change. H&M and Wal-Mart have said they have no plans to leave. Other big chains such as Children’s Place, Mango, J.C. Penney, Gap, Benetton and Sears have said the same.

— Associated Press