Thailand’s outgoing military government used a televised parliamentary session over the festive season to formally legalize cannabis for medicinal and research purposes.

The Narcotic Act of 1979 will be amended when the next Royal Gazette is published and Thais can start receiving medicinal marijuana in 2019. “This is a New Year’s gift from the National Legislative Assembly to the government and the Thai people,” said Somchai Sawangkarn, chairman of the drafting committee.

The junta-appointed parliament seized power in a coup in 2014, but it is about to step aside for a civilian government to take control once more. Before it leaves it is pushing through a range of liberal measures and it also approved a bill allowing same-sex couples to register civil partnerships during the televised parliamentary session.

Laws are being passed with a matter of urgency and commentators suggested that parliament is rushing through anything that will boost its popularity ahead of the elections. Key members of the military are keen to retain a degree of power and use proxy politicians to rule in their stead, while defending themselves against accusations of not respecting human rights among the international community.

Cannabis was used as medicine across the country until a prohibition outlawed it in the 1930s. Since then Southeast Asia has become notorious for dishing out some of the harshest drug penalties in the world. It will be interesting to see whether neighbouring countries follow in Thailand’s footsteps, as the region has the perfect climatic and economic conditions to become a huge producer in the years ahead.

However, anyone caught cultivating or distributing marijuana without a license will still face severe penalties. Selling on the black market will lead to a prison term of between 5 and 15 years, along with a fine of up to a million baht ($30,000).

It remains unclear when the medicinal cannabis program will actually kick off, but there should be a sense of urgency now that Thais have seen the promises made on television. The live vote went 166 to 0 in favour of legalizing medicinal cannabis, while 13 abstained.

The main issue the government needs to wrestle with involves patent requests from foreign firms that want to dominate the market. Thailand’s domestic industry could be strong, but exports represent an even bigger opportunity and multinational producers want to gain a foothold. But Thai activists are demanding the government revoke all of these requests before the new law takes effect to allow Thais to benefit from the burgeoning industry.