Ecuador must be one of the most exciting places on Earth right now, in terms of working towards a new development paradigm. It shows how much can be achieved with political will, even in uncertain economic times.

Just 10 years ago, Ecuador was more or less a basket case, a quintessential "banana republic" (it happens to be the world's largest exporter of bananas), characterised by political instability, inequality, a poorly-performing economy, and the ever-looming impact of the US on its domestic politics.

In 2000, in response to hyperinflation and balance of payments problems, the government dollarised the economy, replacing the sucre with the US currency as legal tender. This subdued inflation, but it did nothing to address the core economic problems, and further constrained the domestic policy space.

A major turning point came with the election of the economist Rafael Correa as president. After taking over in January 2007, his government ushered in a series of changes, based on a new constitution (the country's 20th, approved in 2008) that was itself mandated by a popular referendum. A hallmark of the changes that have occurred since then is that major policies have first been put through the referendum process. This has given the government the political ability to take on major vested interests and powerful lobbies.

The government is now the most stable in recent times and will soon become the longest serving in Ecuador's tumultuous history. The president's approval ratings are well over 70%. All this is due to the reorientation of the government's approach, made possible by a constitution remarkable for its recognition of human rights and the rights of nature, and its acceptance of plurality and cultural diversity.

Consider just some economic changes brought about in the past four years, beginning with the renegotiation of oil contracts with multinational companies. Ecuador is an oil exporter, but had benefited relatively little from this because of the high shares of oil sales that went to foreign oil companies. A new law in July 2010 dramatically changed the terms, increasing the government's share from 13% to 87% of gross oil revenues.

Seven of the 16 foreign oil companies decided to pull out, and their fields were taken over by state-run companies. But the others stayed on and, as a result, state revenues increased by $870m (£563m) in 2011.

Second, and possibly even more impressively, the government managed a dramatic increase in direct tax receipts. In fact, this has been even more important in revenue terms than oil receipts. Direct taxes (mainly corporation taxes) increased from around 35% of total taxes in 2006 to more than 40% in 2011. This was largely because of better enforcement, since the nexus between big business and the public tax administration was broken.

Third, these increased government revenues were put to good use in infrastructure investment and social spending. Ecuador now has the highest proportion of public investment to GDP (10%) in Latin America and the Caribbean. In addition, social spending has doubled since 2006. This has enabled real progress towards the constitutional goals of free education at all levels, and access to free healthcare for all citizens. Significant increases in public housing have followed the constitution's affirmation of the right of all citizens to dignified housing with proper amenities.

There are numerous other measures: expanding direct public employment; increasing minimum wages and legally enforcing social security provision for all workers; diversifying the economy to reduce dependence on oil exports, and diversifying trading partners to reduce dependence on the US; enlarging public banking operations to reach more small and medium entrepreneurs; auditing external debt to reduce debt service payments; and abandoning unfair bilateral investment agreements. Other efforts include reform of the justice system.

One exciting recent initiative is the Yasuní-ITT biosphere reserve, perhaps the world's first attempt to avoid greenhouse emissions by leaving oil underground. This not only protects the extraordinary biodiversity of the area but also the habitats of its indigenous peoples. The scheme proposes to use ecotourism to make human activity compatible with nature.

All this may sound too good to be true, and certainly the process of transformation has only just begun. There are bound to be conflicts with those whose profits and power are threatened, as well as other hurdles along the way. But for those who believe that we are not condemned to the gloomy status quo, and that societies can do things differently, what is happening in Ecuador provides inspiration and even guidance. The rest of the world has much to learn from this ongoing radical experiment.

• Follow Comment is free on Twitter @commentisfree