José Mujica stood out at the inauguration of a huge pulp mill at Punta Pereira, on Uruguay’s south coast. Winged by suited executives, Mujica, the outgoing president, cut the ceremonial tape late last year while wearing baggy jeans turned up at the ankle, a tawny bomber jacket, and shades.

The casual style offers a hint of Mujica’s loathing of unfettered consumerism, his radical past as an urban guerrilla, and his philosophical musings on socialism. Nevertheless, as his five-year presidential term comes to a close, Uruguay has become a bastion of pragmatic economic policies that favor business and foreign investment.

The mill—built together with a small port for fast exports to Asia, Europe, and North America—will turn Uruguay’s plantations of eucalyptus trees into 1.3 billion tons of pulp a year, making it one of the world’s biggest operations. (Pulp is used to manufacture paper.) Half of the $2.5 billion investment in the mill came from Chile; the other half from Finland.

Even as foreign direct investment slumped by 23% in Latin America and the Caribbean in the first half of 2014, it soared by 9% in Uruguay, according to the United Nations. Uruguay, which has a population of just 3.4 million people, is ranked ninth out of 32 countries in the region for “ease of doing business,” says the World Bank. That is far above neighboring Brazil and Argentina, where nationalist policies—supposed to improve the lives of the downtrodden—have foiled foreign investors and local producers alike, and Venezuela, where a socialist revolution began in 1999.

“I believe we have to favor capitalism, so that its wheels keep turning,” says Mujica, 79, wearing a scruffy fleece in the modest living room of his farmhouse, which he prefers to the presidential mansion, “And then take our quota of resources to give to the weakest. But we should not paralyze it.”

A sewn pennant of a Marxist guerrilla cell that operated in Chile in the 1980s and early 90s hangs on the wall, and a bust of Che Guevara, a leader of the Cuban revolution, sits on the bookcase behind him.

Mujica was a leader of the Tupamaros, a left-wing guerrilla organization that terrorized Uruguay’s repressive government in the 1960s and early 70s. He earned noms de guerre like Facundo, a reference to a provincial caudillo cum murderous outlaw in 19th-century Argentina. In one mission, Mujica robbed a federal judge at gunpoint in his penthouse apartment. He was also wounded six times in a shootout with police.

But even during those violent years, Mujica lobbied for moderation, dialogue, and pacifism. His comrades viewed him as “a sort of armed politician, and not a traditional guerrilla,” according to a 2013 biography by Walter Pernas.

After two jailbreaks, Mujica was imprisoned for a final time in 1972. He was tortured and often starved, eating flies or bars of soap, and chewing on bones thrown to him by military officers.

On his release, in 1985, Mujica looked to the future. He does not, at least publicly, harbor resentment about the past. Embracing the shifting political landscape, he argued that the “fight” for equality should employ “new methods,” and he accepted the limits of mainstream politics.

The Tupamaros merged with other left-wing parties to form a faction of the Broad Front, a center-left coalition that won its first presidential election in 2004. Mujica was an agriculture minister and a senator before he led the coalition to re-election in 2009.

He says that he still believes in unarmed revolutions, but he was willing to conform to the checks and balances of democracy because they did not obstruct him from effecting some change as president. “We’re very used in this world to seeing the economy and inequality grow together,” says Mujica, whose term as president ends on March 1. “In Uruguay, that has not happened. The economy grew and people were lifted out of poverty.”

Under the Broad Front, GDP has grown at an average of 5.6% per year, according to Uruguay’s economy ministry, and as the front expanded social security, the proportion of people living in poverty dropped from 40% to around 12%, according to the ministry.

Mujica says his government opted for a middle ground, favoring private sector projects to spur economic growth and modest interventions to distribute wealth. “The numbers speak for themselves,” says Oya Celasun, the mission chief in Uruguay for the International Monetary Fund: Combined local and foreign investment has risen to 22% of GDP under Mujica from an average of less than 15% in the preceding years, according to the government. The pulp mill at Punta Pereira is the biggest single private investment in Uruguay’s history.

“Mujica decided not to recreate the divisions of the past,” says Jimena Blanco, who monitors the Southern Cone countries for Verisk Maplecroft, a risk analysis firm in London, “That despite [his] ideology, it was about finding common ground.” Blanco says this is the major difference from Argentina, where fractious nationalist policies can strangle business opportunities.

Uruguay’s beef production industry, for instance, is thriving as the government funds a comprehensive system for electronically tracking cattle, which has helped it access demanding foreign markets. Conversely, the industry in Argentina has been devastated by periodic export bans and domestic price controls. Uruguay has also developed one of Latin America’s leading software industries by easing the path for foreign startups, many of which have fled Argentina.

“Uruguay is a boutique country,” says Claudio Piacenza, who heads Uruguay’s national chamber of commerce, referring to its small size and friendly investment climate. But Piacenza takes issue with the nation’s fiscal deficit, which has helped fuel inflation; the influence of labor unions; and the continued dominance in some sectors of state-run companies.

Mujica is aware of the criticism he faces across the political spectrum. “We voted for him because he was a guerrilla,” says Alejandro Lema, 80, a frustrated Socialist Party member. “But we wanted more. The results were not what we hoped for.”

Some Uruguayans have grown weary of Mujica’s chaotic leadership style, including how he dealt with the closure of Pluna, the national airline. In mid-2012, the government intervened to save Pluna, but it folded just weeks later, a failure that was compounded by scandals shrouding the liquidation. And Mujica’s communication skills have, at times, left much to be desired. He has often improvised his public statements and then backtracked on them.

Still, the Broad Front was re-elected to another five-year term on Nov. 30, promising the continuation of the policies that have worked in Uruguay thus far. (Mujica, who was constitutionally barred from running for a second consecutive presidential term, was voted back into the senate.)

Social policy was perhaps the best outlet for Mujica’s liberal beliefs. He gave the state control of marijuana production and sales, and legalized abortion and gay marriage. He also channelled these beliefs through his lifestyle choices. Mujica is donating around 62% of his $11,750 monthly salary to a housing program for the poor, and he has given nearly $400,000 to the program since his term began, according to a sworn statement he filed last April. Living simply in his log-heated farmhouse frees him from the shackles of consumerism, Mujica says, but he concedes that his views remain unpopular.

“Life does not deserved to be turned into a slave for the pure and exclusive accumulation of junk,” he says. “But I’m not stupid. I know this is not an economic recipe I can apply to the people.”