After being lukewarm to the idea in the past, Mayor Bill de Blasio on Wednesday night released a report backing the legalization of recreational marijuana, calling for the expungement of criminal pot offenses and limiting sales to New Yorkers who are at least 21 years old.

"Legal cannabis is coming to New York state," the mayor said in the report. "When it does, we must do all we can to make sure that happens in a way that is safe, takes the health of New York City residents into account, and above all provides opportunities while righting historic wrongs."

The report, which was expected to be released Thursday, lays the groundwork for the regulation of recreational pot use in New York City, in anticipation of state lawmakers legalizing it in 2019.

WHAT IS THE MAYOR CALLING FOR?

The automatic expungement of prior criminal records related to marijuana possession arrests, without New Yorkers having to file any paperwork to have the criminal offenses disappear from their records.

The sale of recreational marijuana to be limited to people who are 21 years of age or older. But the report says anyone younger who faces penalties for using pot should face only civil penalties.

Using marijuana in public places would continue to be prohibited. There is still an open question about how that would be regulated. In September, the NYPD began a policy of issuing only summonses for most people caught smoking marijuana in public. The suggestion from the city in the report is that penalties for smoking marijuana in public should mirror penalties for smoking tobacco in certain public places.

The mayor also seems to be endorsing the idea of a delivery system around New York City as a way to transport marijuana to New Yorkers in the safety of their homes.

THE GROWING EXPECTATION THAT NEW YORK WILL LEGALIZE RECREATIONAL POT

Democratic leaders in the state Senate and the state Assembly are in favor of legalization, and there is widespread expectation that the legislature will legalize recreational weed at some point in 2019, especially since Democrats will control 40 of the 63 seats in the state Senate.

The report marks a significant about-face for de Blasio, who for years said he had serious concerns about legalizing recreational pot. It also comes just two days after Gov. Andrew Cuomo backed calls for legalizing recreational marijuana in his 2019 agenda.

There has been growing calls from New York elected officials — particularly since former candidate for governor Cynthia Nixon called for legalization — for the state to legalize recreational pot. Officials and advocates have argued that legalization would not only make sure New York joins the growing list of states legalizing pot but also bring in millions of dollars in revenue by taxing it. Many studies also show that black and Hispanic men in New York are arrested at disproportionate rates for possessing marijuana.