Peru election: Is Ollanta Humala the great transformer?
It was the narrowest of victories but Ollanta Humala has won the Peruvian presidential election with the promise of a "great transformation".
He has pledged to make the country "more just and less unequal".
Mr Humala's promises of change mirror his own transformation from red T-shirted firebrand to sharp-suited, more mature politician.
He seems a far cry from the figure of the 2006 election race who touted his friendship with Venezuelan leader Hugo Chavez.
It was a relationship that lost him the election in a second round run-off to Alan Garcia. Then, a majority of Peruvians voted for Mr Garcia as the "mal menor", or least bad candidate.
Now, by vowing to respect democratic norms and the free market, he has gained new support without losing the backing of those who voted for him five years earlier.
For his supporters, he was the last line of defence against a candidate they feared would vindicate the legacy of Alberto Fujimori, Peru's jailed former leader. In April 2009, Fujimori was convicted of corruption and authorising death squads.
By keeping the former president's daughter, Keiko Fujimori, from being elected, Mr Humala has "saved democracy", according to Nobel Literature Laureate Mario Vargas Llosa.
The odds were stacked against Mr Humala, as most of the powers-that-be lined up behind his opponent - in spite of her father's legacy - because she appeared to adhere more closely to the free-market model.
Much of the media were also heavily biased against Mr Humala - Mr Vargas Llosa withdrew a syndicated weekly column from Peru's main broadsheet, El Comercio, in protest, calling the newspaper a "propaganda machine" for Keiko Fujimori.
Mr Humala and Ms Fujimori won the top slot in April's first round that saw three centrist candidates cancelling each other out. Mr Humala's message seems to have resonated with the one-in-three Peruvians who live in poverty and feel excluded from the country's economic boom.
"In social, political terms, the economic model has run its course," said poet and columnist Mirko Lauer before the result.
"Peru is growing but the [current] president has an approval rate of 30%; people have had enough of the economics of growth."
Outgoing President Alan Garcia has funnelled much of the proceeds of the mining boom into building road, ports and other infrastructure projects.
According to Carlos Monge, an investigator with the Peruvian Centre for the Promotion of Development, social spending has not been a priority.
Mr Garcia managed to sustain Peru's impressively high growth by prioritising foreign direct investment and mining, oil and gas companies, often at the expense of the environmental concerns of indigenous or rural Peruvians.
At the same time, festering social conflicts across the country discouraged millions of dollars of investment.
But Mr Humala's detractors say he is already driving away crucial investment in the mostly foreign-owned mining sector. He plans, for example, to impose a windfall profits tax of up to 40% on firms, in order to build hospitals and schools.
Some investors greeted news of his victory by selling stock, with Peruvian shares registering their biggest-ever daily fall, more than 12% of their value in a single day.
Investors will be closely watching to see who Mr Humala appoints to the positions of finance minister and central bank chief.
Peruvian Chavez or Andean Lula?
In regional terms, Ollanta Humala's victory will add Peru to the varied and growing bunch of left-leaning countries in the region, including neighbouring Bolivia, Ecuador and Brazil along with Argentina, Uruguay, El Salvador, Nicaragua, and, of course, Venezuela and Cuba.
While the US has welcomed Mr Humala's victory, some analysts say it will shift Peru further from its sphere of influence and more towards that of its neighbours, in particular the main regional power, Brazil.
"Economic and political integration is taking place very rapidly in Latin America. The United States is on the other side of that," said Mark Weisbrot, co-director of the Centre for Economic and Policy Research.
But, in a recent interview ahead of the election results, Mr Humala told the BBC that in emulating Brazil's market-friendly economics with social programmes that benefit the poor, he had left ideology behind.
"I don't believe in turning the problems of Latin America into ideological battles. We've been through that and it ended in bloody civil wars," Mr Humala said.
"What we need to do is solve the problems of inequality, illiteracy and malnutrition in Latin America.
"What does ideology have to do with that? It doesn't matter what colour the cat, as long as it catches mice."
Whether paraphrasing the father of China's market economy, Deng Xiaoping, will be enough to calm some foreign investors' nerves remains to be seen.
But his electoral promises of boosting the salaries of public sector workers, increasing the minimum wage, free daycare and a state pension for all over-65s have been surefire vote-winners.