WASHINGTON — The Supreme Court took up a huge sales tax case on Tuesday with the expectation it was ready to bring online shopping under the same rules that apply to ordinary retailers.


But that outcome was less certain after Tuesday’s argument. The justices were clearly divided, but in unusual coalitions of conservatives and liberals.


One side said Congress, not the courts, should set the rules for taxing interstate commerce.


At issue is a 1992 ruling involving mail-order catalogs when the justices found that states may not require out-of-state mailers to collect sales taxes on behalf of their residents.


Now, in the era of online shopping, that decision in Quill v. North Dakota is said to cost states and municipalities between $8 billion and $13 billion a year in lost tax revenue.


Chief Justice John G. Roberts Jr. and Justices Samuel A. Alito Jr. and Elena Kagan said Congress is better suited to devise a new system. Roberts worried that requiring people who run their own websites to collect sales taxes for an estimated 12,000 taxing jurisdictions across the nation would be overly burdensome. There needs to be a minimum threshold, he said.


Kagan added, “Congress can craft a compromise in a way that we cannot.”


Justice Sonia Sotomayor said she is worried that “overturning precedents will create a massive amount of lawsuits.”


But Justice Ruth Bader Ginsburg said it should not be left to Congress to grapple with the court’s previous decision. “If time and changing conditions have rendered (the Quill decision) obsolete, why should the court say: Well, we’ll let Congress fix it?”


Justice Anthony Kennedy agreed that the Quill ruling was “incorrect” and should be overruled. And Justice Neil M. Gorsuch said it was unfair to traditional retailers who must collect sales taxes. “Why should this court favor a particular business model that relies not on brick and mortar but on mail order?” he asked.


Justice Stephen G. Breyer, who could hold the deciding vote, asked questions about the costs and burdens of collecting sales taxes, but he did not signal he was leaning one way or the other.


The case, South Dakota v. Wayfair, began when the state passed a law requiring retailers who do more than $100,000 worth of business there to collect its 4.5 percent sales tax, even if they were located in other states. Predictably, the law was struck down as unconstitutional based on the Quill decision.


But the high court then voted to hear the state’s argument that the Quill decision should be overruled.


For online shoppers across the U.S., the court’s decision could mean higher prices, although many large internet sellers, including Amazon, have already been collecting sales taxes in recent years.


Traditional brick-and-mortar retailers believe the case is about fairness. They have had to collect taxes on all of their sales, while shoppers knew they could often pay less by buying the same products online.


State and local governments see online sales as a source of needed revenue. Last year, the Government Accountability Office estimated these governments were losing $13 billion a year in uncollected sales taxes. A group called the Marketplace Fairness Coalition said the loss was much higher and could be as much as $33 billion a year.


In 1992, the justices ruled the Constitution bars a state from requiring a catalog seller in, say, Maine from collecting the sales taxes owed by a shopper in California. This rule was based in part on the notion that if the catalog company in Maine had no “physical presence” in California, it did not use the state’s roads and resources, and had no obligation to support it.


But South Dakota and 41 other states, including California, are urging the court to overturn the “physical presence” rule. Their lawyers argued the rule is outdated and unfair in an era of internet shopping. They were joined by a lawyer for the Trump administration who said Quill should be overruled.


Defenders of the current system say small merchants, like a craft shop or a bookstore, would face an unfair burden if they are required to collect sales taxes for not just states, but for more than 10,000 cities, counties and other taxing jurisdictions across the nation.


The California state sales tax is 7.25 percent, and cities and counties may add to that. Los Angeles County adds 2.25 percent, for a total of 9.5 percent.


South Dakota’s lawyers also say that better software has made it easy to calculate the correct sales tax for an online consumer.