Workers at Walmart and Sam's Club stores in Pennsylvania who worked off the clock and when they were supposed to be on break, or who were forced to skip their breaks, will receive $151 million in unpaid wages and damages, Pennsylvania's Supreme Court ruled Monday, upholding lower- and appellate-court decisions.

The case affects nearly 187,000 people employed by Wal-Mart Stores Inc. from March 1998 through April 2006.

"This demonstrates that [this] type of shortchanging of workers at a mammoth employer should not be tolerated and that the justice system should provide some form of relief for low-wage workers, particularly through class actions," said Michael D. Donovan of Donovan Axler L.L.C., in Philadelphia, the workers' lawyer.

"We disagree with the decision, and continue to believe that these claims should not be bundled together into a class-action lawsuit," Wal-Mart said in a statement Monday.

"In our view, this was not a case of 'trial by formula' or of a class action 'run amok,' " Justices Ronald D. Castille, J. Michael Eakin, Max Baer, and Debra McCloskey Todd said in the opinion, with Thomas G. Saylor dissenting.

Wal-Mart said it was considering an appeal to the U.S. Supreme Court.

In 2002, Donovan filed a lawsuit in Philadelphia Common Pleas Court on behalf of Michelle Braun, a former employee, and others alleging that the company forced employees to work through meal periods, during breaks, and while off the clock.

In 2006, a Philadelphia jury found that the company had properly handled the meal breaks but had deprived employees of pay when they worked during breaks or off the clock.

Common Pleas Court Judge Mark I. Bernstein awarded $151 million in wages and damages, plus $45 million in attorney fees to Donovan and a cocounsel, with Wal-Mart paying $33.8 million and the rest paid by the workers.

In its appeal to Superior Court and then to the state Supreme Court, Wal-Mart argued it was unfairly subjected to a "trial by formula" instead of having each of the 187,000 employees testify individually.

Donovan said Monday that although the employees did not testify individually, it was not a "trial by formula" because individual pay records were analyzed and summarized.

Attorneys' fees for Donovan and cocounsel Judith Spanier, of New York, remain the only outstanding issue, with the Supreme Court justices sending the case back to Bernstein to recalculate the formula.

In its statement Monday, Wal-Mart said it properly pays its 1.3 million employees and has enhanced its timekeeping systems over the last decade.