Shares of the online retail giants Amazon, Etsy, Overstock, and Wayfair tanked on Thursday after the Supreme Court ruled that states can impose sales on online purchases even if the business doesn’t have a physical presence there. The decision in the case, South Dakota v. Wayfair, reverses a 1992 ruling on Quill Corp. v. North Dakota that said sellers only had to collect state sales taxes if they had a warehouse or office in the state.

The Supreme Court on Thursday ruled 5-4 that states can require online sellers to collect sales taxes. Justice Anthony Kennedy wrote the opinion, and Justices Clarence Thomas and Neil Gorsuch each filed concurring opinions. Modern e-commerce “does not align” with the physical presence required in the 1992 decision, Kennedy wrote.

Chief Justice John Roberts wrote a dissenting opinion, in which he was joined by Justices Stephen Breyer, Sonia Sotomayor, and Elena Kagan.

Moving ahead, states will be able to require retailers to collect state sales taxes on their transactions, whether they have a presence in the state or not. It could mean billions of dollars in additional taxes for big and small retailers alike. Currently, Amazon, for example, collects state sales taxes on the products it sells directly, but it doesn’t for third-party sellers except for in Washington and Pennsylvania, where state laws require it to. (We have a short explainer at what was at stake in South Dakota v. Wayfair here.)

The decision might be a big hit to online retailers — or at least Wall Street thinks it will be. Bloomberg’s Joe Weisenthal tweeted a screenshot of share prices of Amazon, Etsy, Overstock, and Wayfair diving in the wake of the Supreme Court’s ruling:

BREAKING:



*STATES CAN REQUIRE INTERNET TAX COLLECTION, SUPREME COURT RULES



*AMAZON, OVERSTOCK, ETSY, WAYFAIR DROP TO SESSION LOWShttps://t.co/lZpcffvKG1 pic.twitter.com/ReCuqqqED1 — Joe Weisenthal (@TheStalwart) June 21, 2018

Opponents of the Wayfair decision warned it will actually affect small retailers more than it does the big ones. Of course, those aren’t publicly traded.

There’s a lot of cash at stake — not only for the companies involved but also, potentially, for state governments. The Government Accountability Office estimates that state and local governments could have collected up to $13 billion more in 2017 had they been allowed to require sales tax payments from online sellers, as Bloomberg notes. All but five states — Alaska, Delaware, Montana, New Hampshire, and Oregon — impose sales taxes.