GUATEMALA CITY (AP) -- Conservative Alejandro Giammattei has blazed a long, strange path to Guatemala's presidency, which he won on his fourth try.
The 63-year-old spent several months in prison in 2008, when he was director of the country's prison system, after some prisoners were killed in a raid on his watch. He was eventually acquitted of wrongdoing.
Until courts prevented some of the more popular candidates from running in this year's race, he also appeared to be a long-shot candidate in a tumultuous campaign season.
But on Sunday, his get-tough approach to crime and his socially conservative values, including his strident opposition to gay marriage and abortion, finally parlayed favor with Guatemalan voters in a presidential runoff.
Leaning on the crutches he uses because of his multiple sclerosis, Giammattei acknowledged in his emotional victory speech that it had been a long road.
"We won. We are very excited, it is logical, it has been 12 years of struggle," Giammatttei said. "Twelve years waiting to serve my country."
With about 98% of polling places reporting, the country's Supreme Electoral Council said that Giammattei had about 58% of votes, compared to about 42% for former first lady Sandra Torres.
About 8 million Guatemalans are registered to vote in the Central American country. In a nation beset by poverty, unemployment and migration issues, however, turnout as low as 45% appeared to suggest widespread disillusionment with the political status quo in general.
"I just hope Giammattei keeps his promises, and really fights corruption," said Guatemala City resident Leonel Regalado. "We hope he won't steal, because that would be too much for him to steal as brazenly as (outgoing President) Jimmy Morales has."
The presidential campaign was marked by a chaotic succession of judicial decisions, intrigues, illegal party changes and accusations of bad practices that truncated the candidacies of two of the three presidential favorites.
Giammattei's key rival Torres, who had been married and divorced to former President Álvaro Colom (2008-2012), focused on improving education, health care and the economy during the campaign. She also proposed an anti-corruption program, but her Unity for Hope party came under fire because some of its mayoral candidates were accused of receiving contributions from drug traffickers for their campaigns.
She became a key contender after Chief Prosecutor Thelma Aldana was barred from the race on the grounds that she lacked a document certifying that she didn't have any outstanding accounts from her time overseeing a public budget as prosecutor.
Oscar Argueta, secretary-general of the Unity for Hope party, conceded defeat on Sunday.
The new president takes office Jan. 14 and will most immediately face the task of attempting to stem the large flow of migrants headed toward the United States. At least 1% of Guatemala's population of some 16 million has left the country this year.
On July 6, Morales' administration signed an agreement with the United States that would require Salvadorans and Hondurans to request asylum in Guatemala if they cross through the country to reach the U.S. The new president will have to decide whether to nullify or honor the agreement, which could potentially ease the crush of migrants arriving at the U.S. border.
In addition to migration, Guatemalans say they are most concerned about entrenched corruption. Three of the last four elected presidents have been arrested after leaving office on charges of graft, and Morales himself decided to disband and bar a U.N.-supported anti-corruption commission after he became a target for alleged campaign finance violations.
"The person who wins will have to lead a country that is viewed as a nation losing ground in the battle against corruption, because the mandate of the anti-corruption commission wasn't renewed," said Ricardo Barreno, a political science professor at the Central American Institute of Political Studies.
Rogelio Estrada, a father of two who was one of the first people to vote at a polling station in Guatemala City, had other concerns, too.
He hoped the election winner would focus on combatting crime and unemployment "to keep more Guatemalans from going to the United States."