Gustavo Petro won the presidential election in Colombia on Sunday with the help of voters fed up with conservative leaders’ decades of poverty and inequality, and with promises to expand social programs, tax the wealthy, and move away from a fossil-fuel-dependent economy. Petro had been an ex-rebel and long-time legislator. For the first time in South American history, an ex-guerrilla warrior has been elected to be President of Columbia. The former Bucaramanga mayor and business tycoon Rodolfo Hernández lost in a runoff election to Petro. Petro will take office in July, but he faces several challenges, not the least of which is growing public discontent over income inequality and rising living expenses. Hernández had 47.27 percent of the vote, according to election officials’ figures. Following Chile, Peru, and Honduras, his election represents a seismic shift in Colombian politics.

Rodolfo Hernández, the right-wing construction magnate, lost in a runoff election to Mr. Petro, a current senator. Figures reveal that he received 50.5 percent of the vote, defeating his billionaire rival by a narrow margin of 700,000 votes. Since the 1960s, the country has been governed by moderates and conservatives. After months of anti-government protests, which left dozens dead, the vote was held despite considerable dissatisfaction with the country’s current leadership. According to Mr. Petro, victory had been won “for God and for the people” in his words.

His triumph places the third-largest Latin American country on a path of uncertainty, as it faces increased poverty and violence, deforestation in the Colombian Amazon, and growing skepticism of major democratic institutions. On Sunday, Mr. Petro received more than 50 percent, with 99 percent of the ballots tabulated. Just over 47% of the vote was cast for Rodolfo Hernández, the construction magnate who had energized the country with a fiery anti-corruption agenda.