In a closely watched tax case with broad implications for commerce in the digital age, a divided U.S. Supreme Court on Thursday allowed states to collect sales taxes from online retailers that don’t have a have a physical presence in their borders.

By a 5-4 vote in the case South Dakota v. Wayfair, the majority, led by Justice Anthony Kennedy, overturned the court’s 1992 decision in Quill v. North Dakota, which had affirmed the “physical presence” test for state sales-and-use tax collections.