The Electoral Court said it needed more ballots to be counted before declaring a winner. There is no runoff in Panama, so the top vote-getter in the field of seven mostly business-friendly candidates would win outright.
With more than 91% of votes counted, Laurentino Cortizo of the Democratic Revolutionary Party led, with almost 33%. That was just ahead of Rómulo Roux of the Democratic Change party at 31%. About 36,000 votes separated the two men, who together received around 1.2 million votes.
Speaking to reporters, Cortizo said he expected to soon receive a phone call from the Electoral Court to announce his victory. Supporters had begun to clear out of his campaign headquarters after a night of celebrating as returns came in. The Democratic Revolutionary Party, once the political arm of Panama's former military government, lost the last two presidential contests.
Shortly before Cortizo's comments, Roux vowed not to concede defeat, saying the results were too close and suggesting that the race was marred by irregularities.
"We have to guarantee the protection of the electoral process and of democracy. Right now, it's in doubt," Roux said, without providing any evidence of election tampering.
The electoral commission said it would be prudent to count more votes, given Roux's refusal to concede.
Voters cast ballots at roughly 3,000 locations without major incidents.
Whichever candidate emerges as the winner, he will likely take office July 1 for a five-year term with the lowest level of popular votes since the dictatorship of Manuel Noriega ended in 1989.
The election followed revelations of money laundering in the so-called Panama Papers that dinged the country's reputation on the world stage. The trove of secret financial documents showed how some of the world's richest people hid their money using shell companies in Panama and other countries.
Despite the scandal, Panama remains a strategic location for commerce, anchored by the heavily trafficked Panama Canal shipping route and a recently expanded international airport.
Cortizo, a 66-year-old who studied business administration in the U.S., was agriculture minister under President Martin Torrijos and campaigned on vows to clean up Panama's image after recent corruption scandals.
"For Panamanians, as well as many other Latin Americans these days, corruption trumps all other issues, even inequality," said Michael Shifter, president of the Inter-American Dialogue. "In country after country in the region, people are just fed up and are demanding a real change."
Roux, a 54-year-old businessman, had the endorsement of supermarket magnate and former President Ricardo Martinelli, who is in jail awaiting trial on charges of political espionage. Roux held multiple government posts during the Martinelli administration, including minister of canal affairs and foreign minister.
Roux highlighted during his campaign that Panama's economy grew only 3.8% last year, versus a 10.7% expansion in 2012, when Martinelli was president. Roux's association with Martinelli appeared to have hurt his bid for the presidency, Shifter said.
The top three was rounded out by an independent candidate who got on the ballot by collecting thousands of signatures. Ricardo Lombana, 45, is a lawyer who gained prominence via a citizen's movement several years ago that questioned impunity and corruption in the country. Lombana had nearly 20% of the vote.
Lombana's campaign focused on drumming up support via social media, rather than through the costly television spots favored by candidates from Panama's three main political parties.
Turnout was strong at 72% as voters showed up under a hot, cloudy sky Sunday in the sixth presidential election since a U.S. invasion ousted strongman Manuel Noriega in 1989.
Panamanian voters were also concerned about rising unemployment, public schools in decline, unreliable water service and insufficient garbage collection in the capital.
Varela, who was constitutionally barred from re-election, assumed the presidency on promises to crack down on corruption and cut food prices. His greatest achievement was the opening with China, according to political analyst Roberto Eisenmann, who said the diplomatic warming with China "is a step that should have been taken 15 years ago."
China and the U.S. are the main clients of the Panama Canal, the economic engine of the country. The U.S. completed construction of the Panama Canal in 1914, creating a transoceanic path across an isthmus that had been a province of Colombia. The U.S. turned over control of the canal to Panama in 1999, with assurances that the canal would remain a neutral zone that doesn't favor one country over another.
Varela pushed to strengthen ties with China despite years of pressure from the U.S. to backtrack on the warming diplomatic ties. Several countries in Latin America have cut ties with Taiwan in recent years and received generous infrastructure investments as part of China's Belt and Road initiative. These developments have stoked some concerns in Washington that China is building alliances in the region, possibly at the expense of U.S. geopolitical and economic interests.
"We have always lived in the shadow of the United States and it was rather obvious that the United States would have preferred that we did not take this step" to open diplomatic relations with China, said Eisenmann.
Cortizo said he welcomes greater ties with China, provided that the warming relations do not damage Panama's strategic relationship with the U.S.