For 17 months, Toronto police and bylaw officers have been cracking down on illegal pot dispensaries, raiding more than 200 locations, laying hundreds of criminal charges and issuing thousands of dollars in fines. Their attack has been relentless, yet the city still has an estimated 65 shops open for business at any given time.

The campaign, codenamed Project Claudia, began with a headline-grabbing first round of raids in May, 2016, and has now cost millions of dollars in police, staff and court time.

Some storefronts simply reopen within weeks or even days of a raid. Some move – or simply move their business online. One Toronto neighbourhood was blanketed this week with slick pamphlets for a marijuana service modelled on the city’s food-delivery companies.

Many of the criminal charges laid in the initial raids have been dropped or stayed. Some of the accused agreed to peace bonds that place restrictions on them, including shutting down their operations, to avoid facing charges. Other dispensary owners have launched concerted legal battles, including a constitutional challenge that got under way in a Toronto courtroom on Thursday.

But with a chain of provincially controlled pot stores modelled on the LCBO monopoly to start opening next summer, when recreational use of the drug is expected to be legalized across Canada, the game of whack-a-mole being played with illegal storefront dispensaries is expected to intensify, prompting questions about whether it can or should be won – and who should pay for it.

“It’s been frustrating,” Mayor John Tory said. He supported the crackdown – which is the most aggressive in the country and runs counter to approaches taken by police forces in the West – as a necessary move in the face of complaints about the rapid spread of dispensaries across town. “The question you have to ask yourself is: Is it important, as a matter of principle, that you should enforce the laws so that people don’t just think they can go out and flagrantly break the law as it presently exists?”

In a recent meeting with other Greater Toronto Area mayors and Premier Kathleen Wynne, Mr. Tory says he made it clear that he wants the province to pick up the tab for the enforcement campaign, which is currently being paid for by the city.

While police could not provide a cost estimate for their raids, the city’s head of investigations, Mark Sraga, estimates his bylaw-enforcement department alone has spent at least $1-million on the enforcement campaign.

Six officers have worked full-time to lay 812 charges for zoning violations or other bylaw infractions.

Mr. Sraga said city and provincial officials are talking about whether the province should take over enforcement, either through the Ontario Provincial Police or a new agency. “That remains to be seen on who’s going to do enforcement on the illegal storefronts on a go-forward basis,” he said. “Will it be the municipalities? Or will it be the provincial level? Those decisions have not been made yet.”

The mayor said no such talk had come up at the political level and that enforcement was still expected to be left in the hands of local police and bylaw officials.

Ontario Attorney-General Yasir Naqvi was unavailable for an interview. His office released a statement on Thursday amid meetings this week on cannabis laws with law enforcement, public-health officials, federal representatives and First Nations leaders. He did not promise to reimburse municipalities or take over efforts to wipe out illegal dispensaries. But the statement does say the government hopes to determine what support it can provide “where gaps may exist” in enforcement.

“We remain committed to working with our partners to ensure that illegal cannabis retail stores, such as dispensaries, are shut down as quickly as possible,” it said.

Some critics say that, given the market conditions, it is unrealistic to expect the campaign to wipe out Toronto’s dispensaries. Just 40 of Ontario’s legal pot outlets are expected to be open across the province by next summer. Online distribution will also be available at that time. By 2020, Ontario expects to have 150 stand-alone stores, spread across the province. Many say this means a large number of dispensaries will keep operating in the near future.

“In order to shut down the burgeoning dispensary industry in Toronto or anywhere else, you would have to resort to sort of police-state tactics that I don’t think Canadians would accept,” said Kirk Tousaw, a Vancouver-based lawyer who acts for dispensary owners there and in Toronto.

While Toronto’s illegal dispensaries have attracted a large customer base and have shown surprising resilience in the face of heavy legal pressure, the economic landscape will change once legalization takes hold. Much like the end of Prohibition marked the beginning of the end of moonshine runners and speakeasies in the United States, consumers will eventually switch to legal options once they are cheaper and more accessible. However, that could take years, according to Rosalie Wyonch, a policy analyst at the C.D. Howe Institute.

“Unless the city and province can completely undercut the dispensaries with price, there will be an ongoing enforcement cost for the city and province for years,” she said. With Ontario considering pricing recreational marijuana at $10 a gram, she said it’s unlikely the government-run stores will undercut dispensaries on price alone.

“Dispensaries exist now and they’ll continue to exist for a few years until the legal provincial option can cover market demand, be as easy to access and have comparable prices. But it’s a matter of time until the province gets to that point,” Ms. Wyonch said.

In the short term, there will be reasons for consumers to seek out one of the few government-run stores expected in the first years of legalization. Among them will be health hazards, as concerns have risen about the presence of banned pesticides and heavy metals in marijuana sold in dispensaries. Also, is it worth the risk of arrest that comes with being in an illegal dispensary when a safe, legal option exists?

Rick Vrecic’s West End medical marijuana dispensary, True Compassion, was raided in May. He shut it down. His lawyer was able to get the charges dropped, and Mr. Vrecic now works as a consultant in the marijuana business. He says he doesn’t want to risk another arrest by reopening his storefront operation, but he is planning to start an online delivery service.

The current government plans to allow for recreational pot, he says, but not the legal sale of edible cannabis products, which could leave many patients who depend on them out in the cold. And he fears another wave of Project Claudia-style enforcement will see many other Toronto dispensaries give up and shut their doors as well.

“To open up a dispensary in the city of Toronto [since the raids] … is not very smart,” he said. “But I support those people 100 per cent. What they are doing is very brave.”

Toronto officials did score one legal win this week, with an Ontario Superior Court judge siding with city lawyers and granting an interim injunction against a chain of defiant dispensaries called Canna Clinic, demanding that they be shut down. A hearing on whether to grant a permanent injunction is scheduled for December, 2018. Mr. Sraga says the ruling reinforces the city’s authority to enforce its own zoning bylaw, which does not allow storefront pot dispensaries.

But on Thursday, in a courtroom packed with supporters and medical marijuana users, a lawyer for another dispensary owner was mounting a new constitutional challenge, arguing that Canada’s law against possessing pot for the purposes of trafficking was actually invalid during the Project Claudia sweep.

Prominent Osgoode Hall professor Alan Young, who is arguing the case, says a win could mean that all marijuana charges laid between February, 2016 – when a Federal Court judge declared Ottawa’s medical-marijuana regime unconstitutional – and October of the same year – when new federal rules were brought in – would be tossed out.

To make his case, Mr. Young is relying on a ruling from the Ontario Court of Appeal in 2000, which he says links the constitutionality of the criminal law on pot to the question of whether Ottawa had put in place an acceptable regime to exempt patients who need medical marijuana.

Crown lawyers argue that the February, 2016, ruling on access to medical pot, known as R v. Allard, did not invalidate the country’s criminal sanctions for possession of marijuana for the purposes of trafficking during that time.

The dispensary owner at the centre of this latest case, Marek (Mark) Stupak, has run his SoCo Medical marijuana operation since 1996. He says he runs a co-op with more than 2,000 members who need medical marijuana and does not sell the drug for recreational purposes. SoCo has its own grow-op, a dispensary, a smoking lounge and seed shop, plus what he calls an “intake office” to screen new members.

Mr. Stupak, who uses medical marijuana himself to deal with mental-health issues, is no stranger to litigation. He says he has been arrested 10 times over the years, but each time, he fought the drug charges in court and they were dropped.

A small number of medical dispensaries such as his have operated for years, he says, and it was only when new storefronts, many of them transplants from Vancouver, popped up all over Toronto last year to take advantage of imminent legalization that the crackdown began. He hopes operations such as his can stay alive, even in the face of a new provincial monopoly and future crackdowns.

“You don’t get to say, in one sentence, it is so legal that everybody gets to consume this substance, and on the other hand say it is so dangerous that only the government can handle it, sell it – it is confusing,” Mr. Stupak said. “Alcohol? I get it. Plenty of studies point us to negative effects. And yet, it’s in supermarkets.”