MEXICO CITY (Reuters) - Mexico’s Lower House of Congress passed a bill on Friday to legalize the use of marijuana and cannabis for medical and scientific needs, a step closer to outright legalization in a country long scarred by warring drug cartels.

The bill sailed through the Senate in December and will now be sent to President Enrique Pena Nieto, who is expected to sign it.

“The ruling eliminates the prohibition and criminalization of acts related to the medicinal use of marijuana and its scientific research, and those relating to the production and distribution of the plant for these purposes,” the Lower House said in a statement on its website.

The measure passed in a general floor vote with 371 in favor, seven against and 11 abstentions, and now classifies the psychoactive ingredient in marijuana, tetrahydrocannabinol (THC) as “therapeutic.”

Speaking in April 2016 at a special session where world leaders gathered to rethink global strategy in the war on drugs for the first time in two decades, Pena Nieto said drug use should be addressed as a “public health problem” and users should not be criminalized.

Pena Nieto, once a vocal opponent of drug legalization, has said the United States and Mexico should not pursue diverging policies on marijuana legislation. Last year, he proposed a bill to allow Mexicans to carry up to an ounce of marijuana, a measure that has since stalled in Congress.

Since a 2015 court ruling, the government has allowed the importation on a case-by-case basis of medicine with cannabidiol (CBD), an active chemical ingredient of the drug.

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.