The Western Cape High Court has decriminalised dagga - cannabis - allowing it to be used and cultivated by adults for private use.
The landmark ruling also called for parliament to amend sections of the Drug Trafficking Act as well as the Medicines Control Act within 24 months. The judges declared that it was an infringement of personal liberty to ban the use of the freely available substance.
Dagga is South Africa's most widely used drug and is commonly available. It is customary for the drug to be grown in backyards.
Dagga Party leader Jeremy Acton and Rastafarian Garreth Prince led the campaign for its decriminalisation and applied last December for its prohibition to be declared unconstitutional.
According to the act it is a crime to possess a drug, unless it is for a variety of medical reasons.
Prince, who was arrested for possession of dagga in 1989, claimed the drug was a feature of his Rastafarian religion. He became a community legal adviser but was arrested again in 2012 for growing dagga in his garden in Kraaifontein, News 24 reports.
Celebrating outside the high court, the Dagga Party hailed the ruling as a massive step forward for the cannabis movement and claimed it would prevent unnecessary arrests.