ANNAPOLIS, Md. (AP) — The nation’s first tax on digital advertising was struck down as unconstitutional by a Maryland judge on Monday. It’s a law that attorneys for Big Tech have contended unfairly targets companies like Facebook, Google and Amazon in a separate federal case against the same law.

Judge Alison Asti of Anne Arundel County Circuit Court said the Maryland law violates the U.S. Constitution’s prohibition on state interference with interstate commerce. She also ruled that it violates the federal Internet Tax Freedom Act, which prohibits discrimination against electronic commerce.

The state estimated the tax on digital advertising could raise about $250 million a year to help pay for a sweeping K-12 education measure to expand early childhood education, increase teacher salaries, boost college and career readiness and help struggling schools.

Raquel Coombs, a spokesperson for Maryland Attorney General Brian Frosh, said the attorney general’s office is reviewing the decision to determine next steps. Comptroller Peter Franchot’s office also is reviewing the decision, said spokesperson Susan O’Brien.

Verizon Media Inc. and Comcast challenged the law in the state’s court. The law also is being challenged in federal court by the U.S. Chamber of Commerce. Oral arguments in that case are scheduled for Nov. 29.

The Maryland law’s fate in the courts is being closely watched by other states that have also weighed a similar tax for online ads.

The law was enacted last year by the Maryland General Assembly, which is controlled by Democrats, over the veto of Republican Gov. Larry Hogan.

The law would have taxed revenue that the affected companies make on digital advertisements shown in Maryland.

The tax rate would have been 2.5% for businesses making more than $100 million in global gross annual revenue; 5% for companies making $1 billion or more; 7.5% for companies making $5 billion or more and 10% for companies making $15 billion or more.

Republican lawmakers cheered the judge’s ruling on Monday as “a huge win for Maryland’s small businesses who rely on affordable digital advertising to market their services.”

“This is a refreshing check on Maryland’s Democratic Supermajority who has no problem creating new, one-of-a-kind taxes that violate the First Amendment and tax Maryland’s job creators out of business,” said Sen. Bryan Simonaire, the Senate minority leader, and Sen. Justin Ready, the Senate minority whip, in a joint statement.