The cultivation, consumption and distribution of cannabis will be permitted for members of designated clubs after the region's parliament voted to regulate them.
It follows a campaign which gathered 67,500 petition signatures, forcing a government debate.
Cannabis clubs previously existed in a state of legal limbo in Catalonia after emerging in response to strict fines issued by the national government to users caught taking the drug in public.
Some 118 of Catalonia's 127 ministers voted in favour of regulating the clubs, with broad cross-party support for the move.
Clubs must be self-sufficient non-profit associations that only distribute cannabis to members aged over 18. They will be limited to producing 150kg of the dried drug a year and subject to rules designed to stop drug tourism.
In 2014, officials in the Catalan capital Barcelona attempted to curb the boom in cannabis use over fears the city was growing to rival Amsterdam as a marijuana haven. Under the new legal framework, members will not be able to acquire cannabis for 15 days after joining a club.
Alba Verges, chairwoman of the parliamentary health commission, told HuffPost Spain: "The law we will approve is very advanced and gives a very clear message. It’s time for a paradigm shift when it comes to legislating drugs."
Ministers voted on Wednesday after receiving a report compiled with with contributions from more than 30 cannabis experts, including psychologists, sociologists and pharmacologists.
On Saturday Nevada will become the fifth US state to have legalisation the sale of cannabis, while there are growing campaigns to follow suit in Germany and the UK.
Spain's federal government could look to challenge Catalonia's legalisation.
Last year Spain's highest court overturned Catalonia's 2013 ban on bullfighting after Madrid's ruling party argued it harmed artistic freedom and cultural heritage.
In early June the Catalan government announced plans to hold an independence referendum on 1 October, reigniting an ongoing row with Madrid over its secession.