Just as a Washington Post report last week showed Colombia had overtaken Peru in 2014 to once again become the world’s largest coca producer, the Colombian government announced a plan that could turn a different drug into a major (legal) business.

On Thursday, Colombia’s ministers of Agriculture, Health and Justice announced a new decree that would legalize and regulate marijuana for medical use.

It’s a controversial move in a country already known for its illegal drug industry — but the potential economic upsides are significant.

Personal drug use is already decriminalized in Colombia, although conflicting laws and court rulings have created something of a gray area.

Colombia also allows individuals and small business to grow small amounts of cannabis, but the new proposal would authorize qualified businesses and organizations to produce and sell commercial quantities of cannabis products for medicinal use.

That’s a shift in Colombia, where illegal drug production — including marijuana — has helped fund civil conflicts for decades, leaving hundreds of thousands dead and displacing millions more.

But in recent years, particularly under the government of President Juan Manuel Santos, Colombia has moved away from the U.S.-backed War on Drugs. Instead, the country has explored further legalization as a way to undermine the illegal drug economy.

A step towards legalization?

In May, Santos ordered an end to aerial coca eradication saying that the public health risk from powerful herbicides was greater than the benefits of the longstanding anti-coca effort.

Since then, coca production in Colombia has ticked up, and the country is once again the world’s largest producer of cocaine, according to a United Nations report released last week. It’s a potentially concerning turn of events as Santos works to secure a historic peace accord with the Revolutionary Armed Forces of Colombia (FARC), an armed guerrilla organization.

That group has controlled a substantial portion of the country’s illegal drug trade for years, generating billions of dollars of revenue and making them one of the world’s richest rebel groups.

In 2012, then-Defense Minister Juan Carlos Pinzón estimated that the FARC was responsible for 40-50 percent of Colombia’s drug market, although other official estimates put the number much lower, according to a report from the Wilson Center, a think tank associated with the Smithsonian Institute.

But the FARC built its drug empire mostly on the backs of poor campesinos, and legal marijuana could potentially provide a financially comparable alternative to coca production for Colombia’s rural villagers.

Indeed, the legalization of marijuana in several U.S. states over the past two years has further prompted Santos to question Colombia’s drug policies. Sales of the drug have had a considerable economic impact in the four states that have legalized it for recreational use.

In Colorado, one of the first states to fully legalize marijuana, recreational pot sales reached roughly $700 million last year, generating more than $75 million in tax revenue and licensing fees for the state.

Under the rules of the Colombian decree announced Thursday, the government would regulate virtually every aspect of marijuana production to ensure that it is used strictly for medical purposes, with the National Council on Narcotics in charge of handing out permits to grow cannabis plants.

The law must still be signed by President Juan Manuel Santos before it takes effect. But he has already expressed support for legal medical marijuana and is expected to embrace the proposal.

The medical marijuana economy

Colombia’s new decree would open the door for the production and commercialization of dozens of medicinal cannabis products including oils, pills and ointments. Provisions even allow the exportation of marijuana products to countries in which cannabis is legal.

That could prove lucrative for some Colombian businesses.

In the United States, where medical pot is legal in roughly half of all states, medical marijuana products generated an impressive $2.7 billion in sales in 2014. That’s slightly larger than Colombia’s annual coffee exports.

In Canada, farmers who grow marijuana for pharmaceutical companies can make millions of dollars per year in what has become a highly competitive industry.

Meanwhile, Colombia’s national Congress has been debating a measure that would allow the total legalization of cannabis, which could potentially allow for its further commercialization. It’s still unclear how Thursday’s decree might affect the bill in Congress.

But if either piece of legislation becomes law, marijuana could soon be a big – and legal – business in Colombia.