The sites agreed to pay the money after losing an appeal to the Colorado Supreme Court earlier this year.

Denver has received $18.8 million from online travel companies, including Expedia and Priceline, after settling a court battle.

The sites agreed to pay the money after losing an appeal to the Colorado Supreme Court earlier this year. Now, it will boost the city’s affordable housing fund, convention center and more.

The case:

Sites like Expedia allow travelers to book rooms with hotels. They make some of their money by booking rooms at one rate, and then charging the consumer a higher rate. In other words, they mark up the prices.

Denver believed that many of these sites weren’t paying their full tax bills required by the city’s hotel tax. The sites were only paying the hotel tax on what they had paid for the rooms, not the higher price paid by the consumers.

In July 2010, under then-mayor John Hickenlooper, the city notified nine different companies that they collectively owed more than $40 million. This went through several levels of courts before the city ultimately won this year at the Colorado Supreme Court. (Read the ruling here. The justices split 4-3.)

The city and the websites later settled the dispute, and the companies recently paid a total of $18.8 million, covering ten years of taxes, with a penalty and interest, according to Courtney Law, spokeswoman for the Department of Finance.

Similar lawsuits have happened in at least 34 states with mixed results, according to the Tax Foundation.

Where the money’s going:

$5.4 million will cover legal costs for the case.

$3.4 million will go to Visit Denver, which is required by the city’s contract with the organization.

$4.8 million will fund construction and projects at the Colorado Convention Center.

$1.1 million will be available for the convention center and the National Western Center.

$4.1 million will go into the city’s affordable housing fund “because it remains a top priority for the city,” Law wrote.

The Denver City Council consented to the distribution of the funds at its Monday meeting.

The companies involved in the lawsuit were Expedia, Hotels.com, Hotwire, Orbitz, Priceline.com, Site59.com, Travel Webb LLC, Travelocity.com and Cheaptickets.com.