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.
South Africa's highest court has legalised the use of cannabis by adults in private places.
Adults who used marijuana in private would be protected by the ruling until the law was amended.
Activists had argued that the criminalisation of dagga use and possession is a violation of the right to equality, dignity, and freedom of religion.
These sections, the judgment reads, "criminalise the use or possession in private or cultivation in a private place of cannabis by an adult for his or her own personal consumption in private".
The unanimous judgment decriminalises adults smoking cannabis at home and growing enough for personal consumption.
The state, however, believes that it is not in line with the Constitution, as cannabis is more harmful to users than tobacco and alcohol.
The Constitutional Court held these statutory provisions to be constitutionally invalid to the extent indicated because they infringed the right to privacy entrenched in section 14 of the Constitution.
It suspended its order of invalidity for a period of 24 months to give Parliament an opportunity to correct the constitutional defects in the two acts.
But ultimately, it would be up to the court to decide whether the person in possession of cannabis had the intent to deal it, or use it for his/her consumption.
"If a police officer finds a person in possession of cannabis and he or she thinks it is not for personal consumption, he or she will ask the person such questions as may be necessary to satisfy himself or herself whether the cannabis he or she is in possession of is for personal consumption", Zondo said.
If the police officer, on reasonable grounds, suspects that the person concerned is in possession of that cannabis for dealing and not for personal consumption, the officer may arrest the person.