Ex-prison chief Alejandro Giammattei has been elected president of Guatemala, the Electoral Tribunal has declared.
The conservative has 59%, while his centre-left opponent Sandra Torres has 41%, with 95% of votes counted.
Ex-first lady Ms Torres was running for the third time, while Mr Giammattei was making his fourth attempt.
Guatemalans cited insecurity as their main concern, followed by unemployment, high living costs and corruption.
“It wasn’t easy, but the goal was met. It will be an immense honour to be president of this country that I love so much,” said Mr Giammattei.
“We will rebuild Guatemala. I have no words to say how grateful I am.”H
The president is elected for a single four-year term. Current President Jimmy Morales cannot stand for a second term.
As none of the 19 candidates in the first round held on 16 June got the 50% of votes needed to win outright, the top two candidates progressed to a second and final round, with voting held on Sunday.
Alejandro Giammattei will take up office in January 2020.