TORONTO -- The Ontario government will start distributing millions in funding in January to help municipalities cover costs associated with legalizing recreational cannabis.

In a letter to the Association of Municipalities of Ontario, Finance Minister Vic Fedeli says $15 million will first be spilt among the province's municipalities at the start of the new year, with funding allocated on a per household basis and all communities receiving at least $5,000.

An additional $15 million will then go to municipalities that agree to host cannabis retail stores within their boundaries.

The Progressive Conservative government has given communities until Jan. 22 to decide whether they want to opt out of hosting the stores, which are expected to start operating in April.

Fedeli says the province will set aside an additional $10 million as a contingency fund to deal with any "unforeseen circumstances" related to marijuana legalization that municipalities might encounter.

He says the funds for municipalities can only be used for a prescribed set of circumstances including heightened enforcement, increased response to public inquiries, increased paramedic or fire services and by-law or policy development.

"Our government is committed to respecting taxpayers and their hard-earned money," Fedeli said in the letter, a copy of which was obtained by The Canadian Press. "We believe municipalities have an obligation to do likewise."

Fedeli also said that if Ontario's portion of the federal excise tax on recreational marijuana exceeds $100 million, the province will give half of the surplus to municipalities that have not opted out of hosting stores.

The federal government legalized recreational cannabis on Oct. 17. In Ontario, a government-run online store is currently the only way to purchase recreational pot.