The President, Enrique Pena Nieto, has officially published a bill allowing its use for health and scientific purposes.
The bill was passed in April, with an overwhelming 371 members of the Lower House of Congress voting in favour, with only 19 politicians voting against or abstaining.
It also received popular support from the Mexican Senate in December, with 98 senators voting to pass the bill and seven voting against.
The law authorises the Ministry of Health to create new regulations for medical marijuana use, as well as "how to regulate the research and national production of them."
It also establishes that industrial products with concentrations of one percent THC or less would be legal to buy, sell, import and export.
Recreational use of marijuana remains broadly prohibited in Mexico.
But President Nieto – once staunchly anti-drugs – has called for a global rethink towards narcotics.
He said they should be viewed through a public health lens which doesn’t criminalise users.
Mexico has been particularly hard hit by drug violence. An ongoing drugs war has killed around 80,000 people since 2006.
It now joins a small number of countries, including Canada and Portugal, which have legalised the use of cannabis for medical purposes.
Steve Rolles, a senior policy analyst on drug policy with the Transform Drug Policy Foundation, told The Independent: "Its outrageous that for decades now, drug war politics have prevented doctors from making licensed cannabis products available even when it is their clinical judgement that they are the best option for their patients.
"Access to medicines is a fundamental element of the right to health and it is, of course, great to see Mexico joining many other countries in changing its law to finally allow access to those in need.
"It does, however, highlight the continuing injustice faced by both doctors and patients in the UK who seek access to licensed cannabis-based medicines, but are still denied this basic right."
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies