An Ontario Superior Court judge has ruled that Toronto’s bylaw banning hookah bars can stand.

In a judgment released Friday, Justice Robert F. Goldstein chided city council for the ban but upheld it nonetheless, saying it was within the city’s legal rights.

“It is unfortunate that council chose to prohibit rather than regulate hookah use in establishments licensed by the city to carry on business,” Goldstein wrote in the judgment.

Lawyer Ryan Zigler, acting for a group of bar owners who had challenged the ban, claimed the city had acted in bad faith when passing it and had no power to do so.

Goldstein wrote that the bylaw did not prevent the bar owners from running their businesses and that it was “beyond doubt” that it was passed based on concern for the health and safety of Torontonians.

He notes that the bar owners had invested time and money into their businesses — ones that “play a significant cultural role,” he said.

Goldstein wrote that the bylaw could have a “devastating effect” on these bars, and that the city recognizes some might go under because of it.

The ban was passed by Toronto’s city council in December of 2015.

It came following a recommendation from David McKeown, Toronto’s Medical Officer of Health, that the city consider banning hookah, as it was a health hazard to those smoking and inhaling smoke from it.

Correction - October 14, 2016: This article was edited from a previous version that misstated Ryan Zigler's given name.

