Mexican legislators met Friday and voted in a landslide to approve a far reaching medical marijuana bill. The legislation would create a system for cannabis research and legal medicinal marijuana use throughout Mexico.

According to Reuters, the bill, which was approved by the country’s senate in December, passed through Mexico’s lower house of Congress with 371 votes in support of the cannabis legislation, seven opposed and 11 legislators abstaining.

"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.

In addition to opening the door for medical marijuana access and expanded research opportunities nationwide, the legislation would officially classify THC as “therapeutic.”

The bill still needs Pena Nieto’s signature, but the longtime anti-cannabis President has changed his tone in recent years, and even proposed a piece of legislation last year that would have allowed Mexicans to legally carry up to one ounce of cannabis. That bill never made it through Congress, but Pena Nieto’s cannabis support bodes well for the new medical marijuana legislation.

The country’s current medical marijuana program allows the limited importation of low-THC, high-CBD cannabis oil, but the new legislation would expand the program to include in-country production and THC.

While Mexican cartels continue to find creative ways to get their weed into the U.S., President Pena Nieto and Mexico’s lawmakers hope that expanding cannabis legalization laws in a similar manner as the U.S. will help curtail the border-crossing black market cannabis trade. So while that may start with the current medical legislation, the landslide Congressional vote is a good sign for a move towards total legalization in the near future.