Rafael Correa is far ahead of his nearest rival in Sunday's presidential election in Ecuador, and expected to easily win another four-year presidential term. It's not hard to see why.

Unemployment fell to 4.1% by the end of last year – a record low for at least 25 years. Poverty has fallen by 27% since 2006. Public spending on education has more than doubled, in real (inflation-adjusted) terms. Increased healthcare spending has expanded access to medical care, and other social spending has also increased substantially, including a vast expansion of government-subsidised housing credit.

If all that sounds like it must be unsustainable, it's not. Interest payments on Ecuador's public debt are less than 1% of GDP, which is quite small; and the public debt-to-GDP ratio is a modest 25%. The Economist, which doesn't much care for any of the left governments that now govern the vast majority of South America, attributes Correa's success to "a mixture of luck, opportunism and skill". But it was really the skill that made the difference.

Correa may have had luck, but it wasn't good luck: he took office in January of 2007 and the next year Ecuador was one of the hardest hit countries in the hemisphere by the international financial crisis and world recession. That's because it was heavily dependent on remittances from abroad (eg workers in the US and Spain); and oil exports, which made up 62% of export earnings and 34% of government revenue at the time. Oil prices collapsed by 79% in 2008 and remittances also crashed. The combined effect on Ecuador's economy was comparable to the collapse of the US housing bubble, which contributed to the Great Recession.

And Ecuador also had the bad luck of not having its own currency (it had adopted the US dollar in 2000) – which means it couldn't use the exchange rate or the kind of monetary policy that the US Federal Reserve deployed to counteract the recession. But Ecuador navigated the storm with a mild recession that lasted three quarters; a year later it was back at its pre-recession level of output and on its way to the achievements that made Correa one of the most popular presidents in the hemisphere.

How did they do it? Perhaps most important was a large fiscal stimulus in 2009, about 5% of GDP (if only we had done that here in the US). A big part of that was construction, with the government expanding housing credit by $599m in 2009, and continuing large credits through 2011.

But the government also had to reform and re-regulate the financial system. And here it embarked on what is possibly the most comprehensive financial reform of any country in the 21st century. The government took control over the central bank, and forced it to bring back about $2bn of reserves held abroad. This was used by the public banks to make loans for infrastructure, housing, agriculture and other domestic investment.

It put taxes on money leaving the country, and required banks to keep 60% of their liquid assets inside the country. It pushed real interest rates down, while bank taxes were increased. The government renegotiated agreements with foreign oil companies when prices rose. Government revenue rose from 27% of GDP in 2006 to over 40% last year. The Correa administration also increased funding to the "popular and solidarity" part of the financial sector – co-operatives, credit unions and other member-based organisations. Co-op loans tripled in real terms between 2007 and 2012.

The end result of these and other reforms was to move the financial sector toward something that would serve the interests of the public, instead of the other way around (as in the US). To this end, the government also separated the financial sector from the media – the banks had owned most of the major media before Correa was elected – and introduced anti-trust reforms.

Of course, the conventional wisdom is that such "business-unfriendly" practice as renegotiating oil contracts, increasing the size and regulatory authority of government, increasing taxes and placing restrictions on capital movements, is a sure recipe for economic disaster. Ecuador also defaulted on a third of its foreign debt after an international commission found that portion to have been illegally contracted. And the "independence" of the central bank, which Ecuador revoked, is considered sacrosanct by most economists today. But Correa, a PhD economist, knew when it was best to ignore the majority of the profession.

Correa has had some bad press for going against the conventional wisdom and – perhaps worse in the eyes of the business press – succeeding. The worst media assault came when Ecuador offered asylum to WikiLeaks journalist Julian Assange. But here, as with economic policy and financial reform, Correa was right. It was obvious, especially after the UK government made an unprecedented threat to invade Ecuador's embassy, that this was a case of political persecution. How rare, and refreshing, for a politician to stand firm against such powerful forces – the US and its allies in Europe, and in the international media – for the sake of principle. But Correa's tenacity and courage has served his country well.