Los Angeles city prosecutors are sending letters to 439 medical marijuana dispensaries warning them that they must shut down by June 7, when an ordinance to control pot shops will finally take effect after years of debate and delay.

Frank Mateljan, spokesman for the city attorney’s office, said the Police Department and city building inspectors compiled the list of illegal dispensaries. “We’re not saying we have them all,” he said. “This is the initial blanketing of locations that we are aware of at this time.”

Under the ordinance, only those dispensaries that registered with the clerk in 2007, when the City Council adopted a moratorium on any new stores, can remain open. City officials estimate that between 130 and 140 of the original 186 registered dispensaries are still operating.

Hundreds of dispensaries opened in Los Angeles in the last couple of years as city officials failed to enforce the ban and the City Council struggled to write an ordinance to regulate them.

The letters, dated Tuesday, will be sent to both operators and the property owners. They warn that violations of the ordinance are a misdemeanor and could lead to six months in jail and a $1,000 fine. Any stores that stay open in violation of the ordinance could also face civil penalties of $2,500 a day.