A left-wing legislator who rose to prominence during anti-government protests in Chile has been elected the country’s next president.

With almost 99 percent of polling stations reporting, Gabriel Boric won 56 percent of the votes, compared with 44 percent for his conservative opponent, Jose Antonio Kast.

In a model of civility that broke from the polarizing rhetoric of the campaign, Kast immediately recognized defeat, tweeting a photo of himself on the phone with his opponent congratulating him on his “grand triumph”.

At 35, Boric is set to become Chile’s youngest-ever president.

Outgoing President Sebastian Pinera, a conservative billionaire, held a video conference with Boric to offer his government’s full support during the three-month transition.