Wal-Mart Stores has agreed to a corporatewide settlement to improve safety conditions related to trash compactors and cleaning chemicals in more than 2,800 of its stores, the United States Department of Labor announced on Wednesday.

Wal-Mart agreed to the settlement, which includes paying a $190,000 fine, after the Occupational Safety and Health Administration, part of the Labor Department, accused the retailer of putting workers who operate trash compactors in danger. The settlement stemmed from violations found at a Walmart store in Rochester in 2011.

Under the settlement, Walmart’s trash compactors must remain locked when not in use, and may not be operated except under the supervision of a trained manager or monitor. Wal-Mart also pledged to improve training for workers using cleaning chemicals and to upgrade procedures so that workers did not handle undiluted chemicals.

Randy Hargrove, a Wal-Mart spokesman, said the company had long had policies to ensure employees’ safety. “When we learned of the concerns raised by OSHA at our Rochester store in 2011, we immediately addressed them and reinforced the company’s guidelines,” he said.