Guatemalan conservative Alejandro Giammattei secured a crushing victory in a presidential election on Sunday, and promised to seek better terms for his country from an unpopular migration deal agreed with Washington under duress last month.

With preliminary results from over 99% of polling stations counted, the electoral tribunal declared Giammattei the winner with more than 58% of the vote, ahead of his center-left rival, former first lady Sandra Torres, with 42%.

Speaking a few hours before being declared the winner, Giammattei said he wanted to see what could be done to improve the deal that outgoing President Jimmy Morales made to stem U.S.-bound migration from Central America.

Giammattei will not take office until January, by which time Guatemala may be under severe pressure from the deal, which effectively turns the country into a buffer zone, by forcing migrants to seek refuge there rather than in the United States.

"I hope that during this transition the doors will open to get more information so we can see what, from a diplomatic point of view, we can do to remove from this deal the things that are not right for us, or how we can come to an agreement with the United States," Giammattei, 63, told Reuters in an interview.

Threatened with economic sanctions if he said no, Morales reached an accord in late July to make Guatemala - despite endemic poverty and violence that have led hundreds of thousands of its people to migrate north - a so-called safe third country for migrants.

"It's not right for the country," Giammattei said of the deal. "If we don't have the capacity to look after our own people, imagine what it will be like for foreigners."

Asked about Giammattei's comments, U.S. border patrol chief Carla Provost said in an interview with Fox News channel, "It certainly is a concern. We need both Mexico and Guatemala to continue doing what they're doing," referring to Mexico's own campaign to block migrants from crossing its border with the United States.

The third country agreement is also highly unpopular in Guatemala.

A poll published this month by Guatemalan newspaper Prensa Libre showed more than eight out of 10 rejected the idea of the country accepting foreign migrants seeking asylum.

It is unclear how much Giammattei will be able to do to change the deal, which would require Hondurans and Salvadorans to apply for asylum in Guatemala rather than the United States. It also foresees granting U.S. visas to some Guatemalan workers.

Taking over a country also struggling with a 60% poverty rate, Giammattei has promised to erect an "investment wall" on the border with Mexico to curb migration. He has also proposed bringing back the death penalty.

Many Guatemalans are fed up with the political class after investigations by the International Commission against Impunity in Guatemala (CICIG), a U.N.-backed anti-corruption body, led to the arrest of then-President Otto Perez in 2015, and then threatened to unseat his successor Morales, a former TV comedian.

Follow NBC Latino on Facebook, Twitter and Instagram.