Judge James Shelfer ruled Thursday that Florida's 1977 law relating to county tourist development taxes is so ambiguous that he couldn't conclude that companies like Expedia, Orbitz or Travelocity should be required to pay taxes on the marked-up price of a hotel room when they sell it to customers.

Seventeen counties joined in the lawsuit, including Pinellas, Hillsborough, Pasco and Seminole. A similar lawsuit is pending in Broward County, where the online companies are challenging a tax levied against them by county authorities.

The counties and four tax collectors, including Doug Belden of Hillsborough County and Diane Nelson of Pinellas County, allege that the companies have been withholding millions of dollars in taxes from counties for years as they buy hotel rooms at a discount from prominent hotel chains and resell them at a higher price to customers through their web sites.

The online companies, however, counter that they should not be subject to the tax because they are not hotels, just intermediaries stepping in to help the hotel companies fill rooms.

In three days of hearings, the counties argued that case law requires the counties to apply the tax to the product purchased by customers who receive the privilege of the service, in this case the hotel.

Shelfer said that he agreed that the tax should follow the tourist. But he said he was "troubled" by the fact that when the Legislature rewrote the 1949 tax law in 1977 to establish the tourist development taxes, it did not make it clear that the tax should apply to what the tourist paid.

"The problem I'm struggling with is trying to come up with what the Legislature has intended,'' he said.

Complicating that, he said, is that "the travel industry has evolved over the years, and it's in a process of morphing into something else,'' said. "And it appears as if that perhaps it's getting to be the dog rather than the tail."

The ruling is not expected to end debate. Another case is pending in Leon County circuit court involving the state's transient rental tax and how it applies to the online travel companies. Legislators have consistently attempted to clarify the law either in favor of the online travel companies or the counties, but not one of the bills has passed.

Meanwhile, lawyers for both sides expect to appeal the ruling to the 1st District Court of Appeal.