A first-of-its-kind state law that would have required Wal-Mart to spend more on employee health care in Maryland is invalid under federal law, a judge ruled Wednesday.

The state law would have required non-governmental employers with 10,000 or more workers to spend at least 8 percent of payroll on health care or pay the difference in taxes. The measure was directly aimed at Bentonville, Ark.-based Wal-Mart Stores Inc., which has been under attack by critics who say that its inadequate health care plans are forcing some employees to rely on state-funded plans.