(BBC) - Leftist candidate Gabriel Boric has won Chile's presidential election to become the country's youngest ever leader.
In what was expected to be a tight race, the 35-year-old former student protest leader defeated his far-right rival José Antonio Kast by 10 points.
Mr Boric told supporters he would look after democracy, promising curbs on Chile's neoliberal free market economy.
He will lead a country that has been rocked in recent years by mass protests against inequality and corruption.
Mr Boric's victory prompted celebrations on the streets of the capital Santiago, with his supporters waving flags and honking car horns.
In his speech, Mr Boric said he was taking on the job with humility and a "tremendous sense of responsibility", vowing to "firmly fight against the privileges of a few".
Official results gave Mr Boric 56% of the votes against Mr Kast's 44%. Mr Kast conceded defeat barely an hour-and-a-half after polls closed, and with around half of ballots counted.
Both candidates offered starkly different visions for the country, and both are outsiders representing political parties that have never been in government.
Once the most stable economy in Latin America, Chile has one of the world's largest income gaps, with 1% of the population owning 25% of the country's wealth, according to the United Nations.
Mr Boric has promised to address this inequality by expanding social rights and reforming Chile's pension and healthcare systems, as well as reducing the work week from 45 to 40 hours, and boosting green investment.
"We know there continues to be justice for the rich, and justice for the poor, and we no longer will permit that the poor keep paying the price of Chile's inequality," he said.
The president-elect also promised to block a controversial proposed mining project which he said would destroy communities and the national environment.
Chile's currency, the peso, plunged to a record low against the US dollar after Mr Boric's victory. Stock markets fell by 10%, with mining stocks performing particularly badly.
Investors are worried stability and profits will suffer as a result of higher taxes and tighter government regulation of business.
Gabriel Boric's speech was one of inclusion, emphasising that everyone would be a protagonist in his government. And he said he would be a president for all, even those who had not voted for him. He knows that Congress is split and he has his political opponents, but he welcomed it as a chance for dialogue.
This vote was deeply polarised, making Chileans decide between a man who praised the country's dictatorship and a protest leader who, his opponents said, would bring disorder and instability.
But in the end Chileans voted for a new era. And a new kind of president.
For many this result was a natural conclusion of the past few years. Protests exploded in 2019 with a rise in transport costs and, a year later, Chileans voted to rip-up the dictatorship-era constitution, and write a newer, more inclusive one.
Now a new leader has come out of all of this. But one of Gabriel Boric's biggest challenges will be to unite the millions of Chileans who voted for the other side.
Jubilant supporters of Mr Boric reacted to his victory.