The Montana Supreme Court has ruled that online travel companies such as Priceline and Expedia must pay the state’s lodging and vehicle sales tax on the fees they collect from customers.

The high court said in its Wednesday ruling that the nine companies named as defendants must pay back taxes dating to 2010, when the state Department of Revenue filed its lawsuit.

Related: Everything You Need to Know About OTAs’ Tax Woes Around the World

The decision partially reverses a ruling by District Judge Kathy Seeley, who said the online booking companies are similar to travel agents and don’t have to pay taxes.

The justices agreed with Seeley that the state’s 4 percent lodging facility use tax does not apply to the online companies. However, the majority ruled the 3 percent lodging and 4 percent vehicle rental sales tax does apply to the companies’ fees