Slideshow ( 2 images )

MEXICO CITY (Reuters) - Mexico will legalize sales of marijuana-based medicines, foods, drinks, cosmetics and other products early next year, its health regulator said on Wednesday, bringing some forms of cannabis into legal commerce even as the country struggles with the illicit drug trade.

Mexico legalized the use of marijuana for medical and scientific needs in June but has maintained a ban on recreational use and cultivation.

Arturo Tornel, spokesman for health regulator Cofepris, said that the agency plans to formally publish the regulation for pot-based goods within days, allowing those items to enter the Mexico market as soon as a month later.

He added that Cofepris expects distributors and retailers to import the items, with some companies eventually producing items in Mexico using marijuana grown abroad. The regulation does not apply to sales of pure marijuana.

Legalization has stirred debate as Mexico grapples to curb drug trafficking, a major income source for the violent drug cartels that have killed 140,000 people in Mexico over the past decade.

Mexican cartels still make millions of dollars from smuggling marijuana into the United States, despite the trend toward legalization north of the border.

Argentina, Chile, Colombia, Peru and Puerto Rico have also legalized medical marijuana, and Uruguay blazed a trail in 2013 by becoming the first country to allow the commercial cultivation and distribution of weed.

Recreational marijuana is still broadly prohibited in Mexico, but in 2015 the Supreme Court granted four people the right to grow their own marijuana for personal consumption, opening the door to legalization.