AFTER long recessions, Brazil and Argentina still cheer when good economic news comes out. In tiny Uruguay, sandwiched between them, it is old hat. On March 22nd the central bank reported that GDP grew by 2.7% in 2017, bringing the country’s growth streak to 15 years, the longest expansion in its history. Uruguay’s growth since 2011, when global prices of commodities started to fall, puts its neighbours to shame (see chart). Its success shows the value of openness, strong institutions and investment in know-how.

Uruguay’s most recent economic disaster was in 2002, after Argentina defaulted on its debt. Argentines pulled their money out of banks in Uruguay, triggering a bank run there. Thanks to a bail-out from the IMF, it avoided default. That won it a lot of trust with investors, says Jesko Hentschel, the World Bank’s director for Argentina, Paraguay and Uruguay.

Thereafter, Uruguay’s leaders realised that the economy needed to diversify. The Broad Front (FA), a leftist coalition that has governed since 2005, began an effort to “decouple” Uruguay from its neighbours. Under two FA presidents—Tabaré Vázquez, an oncologist who governed from 2005 to 2010 and again since 2015, and José Mujica, a former guerrilla who held office between Mr Vázquez’s two terms—the government created special tax regimes and set up economic zones to attract investment. Uruguay entered new industries, such as software and audiovisual services, which exported to new markets. Between 2001 and 2016 the share of exports going to Brazil and Argentina fell from 37% to 21%.

Recently the government has invested in raising productivity. Public spending on science and technology increased by 73% in real terms between 2007 and 2015. Even cattle farmers adopted new technology. While Argentina slapped export tariffs on beef to hold down domestic prices, Uruguay became the first Latin American country to make all its beef exports electronically traceable, a way of reassuring buyers that problems like foot-and-mouth disease will be caught early. Between 2005 and 2012 Argentina’s beef exports fell by three-quarters; Uruguay now sells more than its larger neighbour.

At the same time, FA governments stuck with the orthodox economic policies they inherited and with practices that make the country attractive to investors, such as keeping taxes low and the judiciary independent of political influence.

The formula has worked. Uruguay kept growing after Brazil and Argentina entered recession in 2014. The middle class, as defined by the World Bank, grew from 39% of the population in 2003 to 71 % in 2015. Uruguay’s income per person is the highest in Latin America.

Not everything is rosy. Growth dropped in 2015 and has not bounced back to its old level. The economy still looks over-dependent on exports, which account for a fifth of GDP. Both inflation, at 7%, and the budget deficit excluding interest payments, at 3.5%, are too high. Uruguay has rigid labour markets. The education system needs reform. The population is ageing.

Taking good tidings for granted, Uruguayans are focusing on their discontents. A rural workers’ movement is demanding lower taxes and electricity bills. Its protests have lasted for weeks, dragging the government’s approval ratings down to an all-time low of 27%. In an election next year the FA could lose power for the first time in 15 years. That would end at least one of Latin America’s longest winning streaks.