Pot will be regulated in the city of Los Angeles.

Measure M won a decisive victory in the primary election Tuesday night, with nearly 80 percent of voters approving the initiative.*

At stake was regulation of the pot industry in L.A., where there are perhaps 1,000 retail shops, with untold numbers of cultivators, delivery services, testing labs, edibles bakers and concentrate makers operating in the city.

Supporters of the measure touted it as groundbreaking.

“Los Angeles is leading the country and world in responsible and inclusive approaches to legalization,” said Los Angeles City Council President Herb Wesson in a joint statement from the Southern California Coalition, a group representing all facets of the cannabis industry. “The passing of Proposition M is a great victory for common sense, law enforcement and all Angelenos. We gave communities a voice in the process, and their voices will be continued to be heard. This measure is what responsible marijuana laws should look like, and we couldn’t be prouder of our city.”

Advocates said the measure could be a model for regulation across the state and the country.

Both Measure M and Measure N — also on Tuesday’s ballot — would have allowed the city to license marijuana businesses for the first time, impose new taxes and toughen penalties for illicit shops ahead of recreational marijuana sales, which will kick in next year.

It was Measure N, drafted by a cannabis trade group, that made the ballot first, and prompted the city to get Measure M on the ballot.

Read background on L.A. marijuana measures

Measure N was a lengthy measure that favored existing shops while laying out detailed regulations for where and how businesses could operate.

In response, city officials drafted a much briefer measure, and provided a flexible plan that gives the City Council power – after gathering input at public hearings – to create a licensing scheme and operating rules for marijuana businesses.

Measure N went down in defeat, with 63 percent of voters against the initiative.

Voters in California decriminalized medical marijuana in 1996, and for a decade after that the city didn’t do much to regulate dispensaries, cultivators, manufacturers and delivery services that claimed the right to operate under a vague state law.

Then, in 2007, the L.A. City Council passed an ordinance to block all new marijuana businesses. But that triggered lawsuits against the city, even as the number of shops continued to skyrocket, prompting voters in 2013 to approve Proposition D. The measure gave 135 medical marijuana dispensaries “limited immunity” from prosecution, but didn’t actually license those shops or give the city power to regulate other cannabis businesses.

That will soon change under Measure M.

“Tonight, we celebrate a measure that protects communities, and doesn’t leave anyone behind,” said Virgil Grant president and co-founder of SCC in the joint statement with Wesson. “Our plan is to take Proposition M’s framework to Los Angeles County next, to Sacramento and beyond, so that this comprehensive approach can serve as a model for cities, states and the entire country.”

Residents of Bellflower also strongly supported an effort to tax cannabis businesses in the city under Measure B, with 73 percent of voters backing the levy.

*This story has been updated Wednesday morning with final election results.