One tiny country has been blazing a liberal trail across Latin America. In the past six years, Uruguay has introduced ground-breaking legislation on abortion, drugs, transsexual rights, and same-sex marriage and adoption.

While President José "Pepe" Mujica and his centre-left Broad Front coalition have been making international headlines for their sweeping reforms – which led to Uruguay being crowned country of the year by the Economist magazine in 2013 – less well known is that up to 3,000 civil society activists have been the driving force behind the country's extreme makeover.

"Just 10 years ago, these laws would have been unthinkable," Michelle Suárez, a member of the lesbian, gay, bisexual and transgender (LGBT) group Ovejas Negras, or Black Sheep, said when the legislation was passed. Suárez, the country's first transgender law graduate, drafted the proposal for the equal marriage bill passed by parliament last year and worked on legislation that granted equal adoption rights to same-sex couples in 2009.

When Broad Front won the election in 2004, its manifesto showed little sign of such an approach. "This [liberal] agenda has been conceived by social movements systematically alienated from political power," says Lilian Celiberti, a teacher and member of Cotidiano Mujer, which campaigns for gender equality.

In recent decades, there has been a more collaborative approach to social activism in Uruguay. Formerly disparate organisations representing women, young people, students and LGBT citizens have been joining forces to reach a wider audience and gain political influence.

"Until the 1990s, [LGBT] groups' concerns were limited to discrimination on the grounds of sexual orientation and gender identity," Diego Sempol, a history professor and member of Ovejas Negras, says. "But people are not only excluded for being gay, lesbian or trans, but for being an unemployed gay [person], a black lesbian or a poor trans woman."

The gay pride parade of the 1990s, which attracted about 300 people, evolved into the diversity march in 2005, which focused on a range of issues affecting minority and marginalised groups. Last year, it was attended by an estimated 30,000 people, and "is now an event nobody wants to miss", says Celiberti.

According to the sociologist Diego Pieri, rights groups were keen to collaborate "once they were able to identify our common enemy: conservative Uruguay and its hypocritical, intolerant structures".

However, some causes have achieved success more quickly than others. Since 1985, there have been seven bills intended to decriminalise abortion, including a law passed in 2008, but vetoed shortly after by the president at the time, Tabaré Vázquez, even though his Broad Front party had initially championed the initiative.

The separation of church and state in Uruguay took place as early as 1917, meaning that religious values have, perhaps, had less influence on politics in the predominantly Catholic country than in other parts of Latin America.

When Mujica came to office in 2010, he promised he would not exercise his right to veto the abortion reforms, despite opposition from religious campaigners. The legislation was finally signed into law in 2012.

Celiberti believes Uruguay's male-dominated political system contributed to the legal delays. "Decisions over women's bodies touch the essence of patriarchy, which is imprinted on the whole political spectrum," she says.

Not all liberal reforms took as long to implement as the abortion act, however. The introduction of a state-regulated market for cannabis was more swiftly approved to make Uruguay the first country in the world to make it legal to grow, sell and consume marijuana.

Activist groups such as Proderechos, or Pro-Rights, played a major role in the country's overhaul of its drug policies. In the five years leading up to the reforms, youth, feminist and student organisations teamed up with health experts and NGOs to push the drugs debate to the top of the political agenda. Outdoor events were held, attracting thousands of people, to show that even a lot of people smoking marijuana together entailed no risks.

Despite the campaigns, few expected the president to make such radical changes to the country's drug laws. "He definitely took us by surprise," says Pieri. "Mujica's courage was remarkable."

Decades of persistent and collaborative campaigning by rights groups have paved the way for Uruguay to become a more open, integrated and tolerant society, but, say activists, there is no room for complacency. Much more needs to be done to achieve equality, particularly in rural communities. "If two boys kiss each other in some of Montevideo's suburbs or in the countryside, they could still be at serious risk of physical violence," Sempol says.