Just because a municipal official saw men praying at a community hall doesn't make that place a mosque, a Quebec judge has ruled, thwarting a bid by the city of Mascouche, a suburb outside Montreal, to shut down a Muslim centre.

The judgment is the latest twist in a series of disputes where municipal officials in Quebec have tried to curtail the operations of mosques and Islamic centres by citing zoning regulations.

Mascouche was trying to shut down the Essalam community centre, saying that the building, in a strip mall, had a zoning that forbids places of worship.

Story continues below advertisement

"This ruling will have a significant reach for all municipalities in Quebec that have to deal with this kind of situation," Mascouche Mayor Guillaume Tremblay said in a statement sent to The Globe and Mail.

In his ruling, Quebec Superior Court Justice Pierre Labelle said that Mascouche had engaged in a fallacious form of reasoning – "a sophism," he said – when it argued that since people pray in a place of worship, a community centre that allows prayers must be a place of worship.

"To that extent, any individual or collective prayer held in a residence, school or workplace would turn that location into a place of worship," Justice Labelle said in his decision released Wednesday.

Similar stories have been public controversies for years in Quebec.

A year ago for example, Quebec Superior Court Justice Jean-Yves Lalonde decided in favour of the Badr Islamic Centre in its dispute against the city of Montreal. The city had told the Badr centre that it could no longer hold religious activities after a zoning amendment in the Saint-Léonard borough. However, the judge found that city employees had acted in bad faith and he ruled that the centre had an acquired right.

Justice Lalonde noted that the new locations where Montreal allowed places of worship tended to be in industrial areas, which was inconvenient to Muslims. "The move by the city … creates ghettoization, access problems and is a form of discrimination compared to traditional Catholic churches, which are generally in residential areas," the judge wrote.

In the Mascouche case, Justice Labelle said the city had not acted in bad faith but held a rudimentary, ill-informed grasp of religious rights.

Story continues below advertisement

The problem began in the spring of 2015, when Mascouche Muslims sought a permit to use a hall for community events that included prayers and religious conferences. At the time, several Quebec municipalities were dealing with mosque controversies.

In Montreal, then-mayor Denis Coderre used a zoning change to block the polarizing imam Hamza Chaoui from opening an Islamic community hall in the city's east end.

In Shawinigan, a Muslim cultural centre relocated after town council initially allowed a zoning change, then rescinded its decision after a public backlash.

By the end of the year, the Mascouche Muslims amended their application, removing mentions of religious activities. They were granted a permit in March of 2016.

Some residents then complained that the hall was being used like a mosque, alleging that more than a 100 people gathered in the evening to pray, Justice Labelle said in his ruling.

The city took action the night of June 29, 2016. It was during the month of Ramadan, when observant Muslims fast during the day and gather for communal meals and prayers after sunset.

Story continues below advertisement

Around 11:30 p.m., a city bureaucrat and two police officers showed up. They reported finding about 30 men praying in a room. Others who were in the room and outside were not praying. A week later, the city rescinded Essalam's permit, saying that the hall's use for religious activities contravened zoning. Essalam hired the high-profile constitutional lawyer Julius Grey and challenged the decision.

Justice Labelle noted that the zoning bylaw only talked about prohibiting places of worship but other city documents talked about a ban on religious activities. "The court is of the opinion that city cannot extend its ban beyond the very words of its bylaw," he wrote.

He also said Mascouche engaged in sophism when it equated holding prayers with the presence of a place of worship. "The initial premise is not universal because prayers can be uttered in all places and not exclusively in a place of worship."

While he chided Essalam for being disingenuous about holding prayers in its hall, Justice Labelle said the city was obstructing religious freedom.

Mascouche has 30 days to appeal Justice Labelle's decision.