The Supreme court has legalized the private use of marijuana, upholding a lower court’s ruling that found the criminalization of cannabis was unconstitutional.

In delivering the Constitutional Court’s unanimous verdict, Deputy Chief Justice Raymond Zondo on Tuesday declared 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 in Johannesburg.

The court also ordered parliament to draft new laws within 24 months to reflect the order.

However, the judgement did not specify the amount that can be used by an adult in private use.

Activists, including members of the Rastafarian movement and traditional healers, greeted the ruling with loud applause.

Outside, pro-cannabis campaigners lit pipes and rolled joints to celebrate the news, filling the air with the distinctive aroma of marijuana.

“I’m happy I won’t be getting any more criminal records for possession,” Ruaan Wilson, 29, told AFP before pausing for a puff.

“Now, we can get police to focus on real drugs and thugs,” he added.

A court in Western Cape had ruled in March 2017 that a ban on cannabis use by adults at home was unconstitutional, a move that effectively decriminalised it in the province, which includes Cape Town.

But the ministers of justice, police, health and trade challenged that finding, arguing that there was “objective proof of the harmful effects of cannabis”.

Activists have held marches over the years to demand that the law be changed to allow people to smoke “weed”, which is called “dagga” in South Africa.

But opponents fear crime connected to drug abuse and users graduating to harder drugs.

They also cite medical research which suggests a link between heavy use of marijuana and psychotic disorders such as schizophrenia.

The country’s Medical Research Council has already launched trials to help guarantee quality, consistency and standards, according to local media.

“We have used cannabis to treat anxiety, colic in children and as an antiseptic in secret for many years,” said Phephsile Maseko, of the Traditional Healers Organisation.

“Now we will be able to develop the plant even further.”

Previously, possessing, growing or using marijuana for personal use – even in small quantities – exposed users to fines of up to hundreds of dollars as well as jail time. Penalties for selling it were far higher.