South Africa's top court ruled Tuesday that private, personal cannabis use is legal in a landmark case that has pitted officials against marijuana advocates and the judiciary.
Deputy Chief Justice Raymond Zondo, delivering the Johannesburg-based Constitutional Court's unanimous verdict, said the law banning marijuana use in private by adults "is unconstitutional and therefore invalid".
"It will not be a criminal offence for an adult person to use or be in possession of cannabis in private for his or her personal consumption," he said, reading the ruling to cheers from the public gallery.
The court also ordered parliament to draft new laws within 24 months to reflect the order.
A court in the Western Cape region had ruled in March 2017 that a ban on cannabis use by adults at home was unconstitutional, effectively decriminalising it in the province that includes Cape Town.
But the justice, police, health and trade ministers challenged that finding, arguing that there was "objective proof of the harmful effects of cannabis."
Tueday's ruling will not decriminalise the use of the drug in public nor the offences of supplying or dealing but cultivation for personal, private use will no longer be illegal for adults.
Previously, possessing, growing or using marijuana — even in small quantities — could technically lead to jail time, a fine and a criminal record.
Three cannabis users who had faced prosecution for using the drug argued in the Constitutional Court that the prohibition "intrudes unjustifiably into their private spheres".
Ahead of the ruling, activists clutching banners reading "Weed are free now" and Rastafari flags gathered outside the court in central Johannesburg.
Other boards read "Free the weed", and "Legalise weed, end economic depression #weedislife".
Some activists also called for cannabis to be decriminalised for use in public.
"It's not enough, we also have privacy in person, as we walk in a public space, therefore we should be allowed to carry cannabis in public," said Jeremy Acton, leader of the Dagga Party in South Africa which advocates for the rights of cannabis users.
Several of the roughly 100 activists sang struggle-era anti-apartheid songs.
Previous court hearings on the emotive issue have drawn protests by those opposed to legalising cannabis, as well as by those in favour of decriminalisation.
Use of cannabis and medicinal marijuana has gained popularity in some parts of the world to ease suffering from cancer, glaucoma, HIV and AIDS, and other serious conditions.
But opponents fear crime connected to drug abuse and users graduating to harder drugs.
The country's Medical Research Council has already launched trials to help guarantee quality, consistency and standards, according to local media.
A South African opposition lawmaker Mario Oriani-Ambrosini in 2014 submitted a draft law calling for the legalisation of marijuana but died soon after.
Globally, the legal status of cannabis varies widely. In Portugal, for example, possession and use is largely decriminalised, while users in Saudi Arabia face the death penalty.