Updated at 4:59 p.m.

Online travel companies such as Expedia and Travelocity are on the hook for more than $60 million in back sales taxes after a Washington appeals court ruled Thursday that the companies are liable for sales tax on hotel rooms they sell through their websites.

The three-judge panel of the D.C. Court of Appeals rejected the travel companies’ argument that the only taxable transaction was between the customer and the hotel. The court said that the D.C. government can tax the difference between the actual cost of the room, which the hotel receives, and the higher rate the travel companies charge the customer in order to make a profit.

“[T]he meaning of the statute is clear: by imposing tax on the ‘sale or charge . . . for any room . . . furnished to transients by any hotel,’ the sales tax statute is taxing the sales transaction by which a customer purchases a hotel room in the District of Columbia,” Judge Corinne Beckwith wrote for the court. “The OTCs’ retail margins are a part of that sale.”

Last year, the travel companies—Expedia Inc., Hotels.com LP, Hotwire Inc., Orbitz LLC, priceline.com, and Travelocity.com LP—and the city reached an agreement on how much money in back sales taxes the companies would owe if they lost on appeal. According to that agreement, the companies will owe more than $60 million for hotel room sales between 1998 and 2011.

In announcing the agreement last year, the Office of the Attorney General said that if the city prevailed, the monetary recovery would be largest ever for the District through a case that was litigated.

“This is a huge victory for the District’s taxpayers, and it ensures that online travel companies have to follow the same rules as everyone else,”  D.C. Attorney General Karl Racine said in a statement.

Darrel Hieber, a partner at Skadden, Arps, Slate, Meagher & Flom, argued for the online travel companies. He also could not immediately be reached for comment.

The District charges a sales tax of 14.5 percent on the gross receipts of hotel room sales. The online travel companies argued that the hotel, which furnished the room, was the only taxable vendor when it came to sales taxes. The city countered that the tax should apply to the sale or charge for any room furnished by a hotel, even if the seller—in this case, the online travel companies—did not actually furnish the room.

The court found that the city’s interpretation of local tax law was reasonable. Beckwith wrote that “an examination of the District’s sales tax provisions as a whole lends support to the District’s contention—and the well-reasoned conclusion of the trial court—that the tax is levied on the ‘sale or charge’ for the service, rather than on the provision of the service itself.”

The court also rejected the online travel companies’ argument that it would be unfair to force them to pay back taxes, given the city’s delay in pursuing legal action.

“It is clear from looking at the OTCs’ statements to investors and to the SEC that the OTCs understood, since at least 2002, that they might owe sales tax on the full amount of their merchant model sales,” Beckwith wrote.

The ruling was not a total loss for the online travel companies. The appeals court upheld the trial judge’s ruling that the companies could not be taxed on the “sales tax reimbursement” they charged to customers, which covered the sales tax that the hotel owed for the amount of money it received from the sale of the room.

Judge Theodore Newman joined Beckwith’s opinion. Judge Roy McLeese III agreed that the travel companies were subject to the sales tax, but he wrote in a separate opinion that he would hold the travel companies liable for tax on the full amount of the sale to the customer, including the “sales tax reimbursement.”

Updated with comments from Attorney General Karl Racine.