TORONTO -- Businesses that illegally sell recreational marijuana after the government of Ontario sets up its own shops could be fined up to $1 million under legislation tabled Wednesday.

One of the main aspects of the proposed law, which would take effect once the federal government makes the drug legal in July 2018, is to crack down on the array of illegal dispensaries, Attorney General Yasir Naqvi said.

"We are going to work very hard towards that," he said. "We have put very strict penalties in that regards....We feel very comfortable that the regime that we will put in place will be a significant deterrent for these illegal businesses."

The bill also contains new penalties for people that are convicted of illegally selling or distributing cannabis, including fines of up to $250,000 and/or jail of up to two years less a day.

For every day those people or businesses continue to sell marijuana after being convicted the first time, they will be subject to further fines of up to $100,000 and $500,000, respectively.

The law would also allow police to immediately close premises they suspect are being used for the illegal sale or distribution of marijuana.

Ontario was the first province to announce its detailed marijuana plan last month, which includes the sale of the drug in up to 150 stores run by the Liquor Control Board of Ontario.

They are known in the legislation as the Ontario Cannabis Retail Corp., though Naqvi admitted the name might be jazzed up a little.

"That is the legal name of that company," he said. "There will be branding that we'll do, so that's to come, and sort of a visual logo."

Those stores will only sell to people 19 and older, a minimum age that would also apply to possession, home growing and use of marijuana.

People under 19 caught using, growing or possessing weed could be fined up to $200, or a court could refer them instead to an educational or prevention program.

"I want to be very clear that there will be no criminal record, it's under a provincial offence...our purpose is not to punish our youth but to educate our youth," he said.

Ontario Premier Kathleen Wynne said ahead of the bill's introduction that an important part of the Liberal government's plan is shutting down the current dispensaries.

"I think that there needs to be a regulation of cannabis and we have a history in this province of regulation of alcohol and I think that doing this in a safe, responsible way means that we put some parameters around the distribution of this substance," she said.

"As resources are identified to deal with enforcement and education we recognize that municipalities need to have a substantial share of that because they are actually on the ground going to be doing enforcement."

Some Ontario municipalities have expressed concern that they will have to foot the enforcement bills for shutting down marijuana dispensaries.

Toronto Mayor John Tory said Wednesday he is "looking forward" to getting money to help with that, because it's about the rule of law.

"These shops, to the best of my knowledge, are illegal, have always been illegal, will continue to be illegal and are not contemplated as being part of the regime going forward," he said.

"We want to be able to keep children and families and neighbourhoods and schools and retail strips safe and stable and that we need to be able to do that so it isn't kind of a Wild West environment where people can just go out and set up any kind of a shop they want. I don't think anybody really supports that except perhaps the people that are operating the shops."

The bill also includes a ban on consumption in public spaces or workplaces. But medicinal marijuana will be regulated differently, banned only where tobacco smoking is currently prohibited, such as enclosed public places.

The government has been coy on potential pricing, saying decisions will be made after more details come from the federal government, but that the aim is stay away from overly expensive prices that fuel illegal sales.

"This actually isn't about money, from my perspective," Wynne said. "This is about making sure that a substance that needs to be regulated is regulated in a safe and responsible way."

Municipalities in Ontario will find out in the coming weeks where the government wants to locate the first batch of cannabis stores, but the finance minister has said none will be near schools.