The Illinois Supreme Court struck down a state law Friday that required online retailers, like Amazon, to collect sales tax if they have in-state Web affiliates, according to Associated Press.

The court decided the law violated federal rules, which prohibit putting a discriminatory tax on digital sales. It's the first time a high court has thrown out a law like this -- 18 other states have similar laws. In New York, the court upheld the law, spurring Amazon and Overstock.com to petition the Supreme Court.

Related stories

Amazon ended its affiliates program in Illinois when the law was adopted in 2011. Web affiliate programs let online retailers pay Web sites for linking to products. The state law forced the companies to collect sales tax from purchases made through links from sites based in Illinois even if the retailer was not.

The court's majority argued that there doesn't seem to be a difference between digitally linking customers and using means that aren't taxed, like advertising promotional codes in print publications or radio broadcasts.

Justice Lloyd Karmeier, who disagreed with the other justices but was outvoted, said the state law doesn't violate the federal law because it wasn't adding a new type of tax, just changing the scope of who has to collect them.