Second-place candidate Romulo Roux lagged just two points behind Cortizo
US-educated political veteran Laurentino "Nito" Cortizo won Panama's presidential election in an unprecedented close race with the electoral tribunal declaring a winner after 95% of votes had been counted.
The results were announced on Sunday.
In his victory speech, Cortizo called for national unity, after winning just a third of the votes with the country clearly divided about its choice in the one-round election.
"Panama won today, and today more than ever, Panama needs to join forces," the former agriculture minister told cheering supporters in the midnight speech at his campaign hotel.
During the campaign he vowed to clean up politics after Panama's image was tarnished by a corruption scandal involving Brazilian engineering firm Odebrecht, and the Panama Papers leak of millions of documents detailing tax evasion by the world's wealthy in the nation famous for its canal.
Exclusive: U.S. must cultivate Central America or lose out to China: Panama president-elect (Reuters) https://t.co/sXGD5BQm9y— Choonsik Yoo (유춘식) (@choonsikyoo) May 6, 2019
"Panamanians do not want, or merit, and won't put up with more of the same," Cortizo added. "The chaos is over. Public funds belong to the public, and they are sacred."
He takes office on July 1 and will have to balance relations with Washington and Beijing, after outgoing President Juan Carlos Varela rankled the US by formally establishing diplomatic ties with China, now the second largest canal client.
Second-place candidate Romulo Roux lagged just two points behind and was reluctant to concede, saying he had found some irregularities in ballots in some voting areas.
Varela congratulated Cortizo in a call broadcast live in an apparent bid to show stability after the tight result.
No election in the Central American nation has produced such a narrow result since the 1989 restoration of democracy that followed the US invasion to topple dictator Manuel Noriega.
The atmosphere had been tense at the hotel where Cortizo's supporters gathered for hours to await their candidate, holding his Democratic Revolution Party's (PRD) red, white and blue flags.
They broke into cheers of "Nito, Nito, Nito!" after the electoral tribunal called with the news.
Roux, 54, who previously worked at the authority that governs the canal and was foreign minister under jailed former president Ricardo Martinelli, posted on Twitter shots of ballot tallies he said were miscounted, as evidence of irregularities he said could change the result.
He said his party needed to see all the tallies from across the country before accepting a result, but stopped short of saying he had won.
Opinion polls ahead of the May 5 election had given Cortizo a much wider lead, failing to measure the support for a young anti-establishment party whose candidate, Ricardo Lombardo, garnered almost a fifth of votes.
Both Cortizo and Roux represent long-established parties.
"In part, it's been a surprise, but in the end, the Panamanian people have made the right decision," said Tomas Vega, a PRD candidate for Congress.
Cortizo, whose children have US passports and who still flies to Austin each year to watch college football team the Texas Longhorns, says he wants to improve ties with the US.