Wal-Mart has agreed to pay $40 million to tens of thousands of current and former employees, bringing an end to a years-old Massachusetts class action that accused the retailing giant of cheating workers out of overtime and meal breaks.

The settlement, the largest in Massachusetts history, will be disbursed to over 85,000 current and former employees. Under the terms of the agreement, anyone who has worked for Walmart at any time since August 1995 will receive a portion of the settlement.

Payments will range from $400 to $2,500, depending on how long the employee was with the company. The average employee will receive around $750.

The suit, filed in Massachusetts in 2001, accused Walmart of denying workers rest and meal breaks, and of forcing employees to work beyond their scheduled shifts without paying them overtime. The complaint was filed on behalf of Elaine Polion and Crystal Salvas, who have long since left the company. The incidents at issue are hardly unique; Walmart has faced a number of similar suits over the past few years.

Last December, the retail giant agreed to pay up to $640 million to settle an eye-popping 63 class action lawsuits alleging labor law violations similar to those in Polion and Salvas's suit. That settlement closed out cases in various state courts and a federal court in Nevada. Last month, U.S. District Judge Philip Pro approved an $85 million final settlement for the Nevada action.

Carolyn Beasley Burton, the plaintiffs' attorney in that action, said that the settlement would yield between $150 and $1,000 for hundreds of thousands of employees. Wal-Mart general counsel Tom Mars said that the suits were several years old and that their allegations "are not representative of the company we are today."

Even so, the flood of settlements does little to mitigate Wal-Mart's image among its critics as a soulless corporate behemoth, although the company probably doesn't much care. Wal-Mart is the world's largest public corporation by revenue, and the United States's largest private employer and grocery retailer. Its massive size gives it the freedom to cut corners without exposing itself to much financial liability.

In the 2008 settlement, for example, even a $640 million payment -- the largest permissible would comprise less than 0.1 percent of the company's revenue for that year alone.

Wal-Mart, whose long-standing slogan "Always Low Prices" was finally shelved in 2007, has fared relatively well in spite of the recession, with stocks rising 20 percent in 2008 as shoppers tightened their belts. Chief Financial Officer Tom Schoewe said last December that Wal-Mart's "balance sheet is stronger today than it was a year ago."

But some say the lawsuit will send a stronger message. "For many employers, this settlement will serve as a reminder to take the payment of earned wages and benefits seriously," wrote Philip Gordon of the Gordon Law Firm. "For many other employers, it will provide comfort that all Massachusetts businesses must operate on a level playing field."