Panamanians vote in presidential elections Sunday from a crowded field of eight candidates, with the protege of a graft-convicted ex-head of state in the lead.
Conservative lawyer Jose Raul Mulino, 64, is far ahead in opinion polls with about 37 percent of voter support, according to the latest survey.
But he was made to wait for a last-minute court decision Friday that finally validated his run.
Of the seven other candidates, only three have approached 15 percent support in the Central American country battling deep-rooted corruption, a severe drought that has hobbled its economically critical Panama Canal, and a stream of US-bound migrants passing through its jungles.
Trailing Mulino are social democrat ex-president Martin Torrijos and two center-right politicians: Martinelli-era foreign minister Romulo Roux and Ricardo Lombana, a former envoy to the United States.
Polls show there are more undecided voters than support for any of Mulino's seven rivals.
Mulino replaced ex-president Ricardo Martinelli as the candidate for the right-wing Realizing Goals (RM) party after Martinelli lost an appeal against a money laundering conviction.
The candidacy of Mulino, who had been Martinelli's vice-presidential running mate until the ex-leader's disqualification, was challenged on the basis that he had not won a primary vote or picked his own running mate, as required by law.
The Supreme Court dismissed that complaint Friday in a ruling welcomed by Martinelli, who most Panamanians believe will wield control from behind the scenes, according to a recent poll.
Martinelli, who remains popular in Panama, has found asylum with his dog Bruno at the Nicaraguan embassy, from which he campaigned for his protege.
Many long for the days of economic prosperity under Martinelli's government from 2009 to 2014, aided by an infrastructure boom that included the enlargement of the canal and construction of Central America's first metro line.
Polls show voters' main concerns are the high cost of living, access to drinking water and crime.
Mulino, who served as Martinelli's Public Safety chief, has dismissed the criminal case against his former boss as politically motivated, and could soon have the power to pardon him.
On Friday, Panamanian salsa legend and activist Ruben Blades called his compatriots not to vote for a man he described as "a frontman for a confirmed crook."
President Laurentino Cortizo of the majority PRD center-left party will vacate his seat after a term marred by allegations of widespread official corruption, declining foreign investment and rising public debt.
Panama has a presidential one-term limit.
About 45 percent of jobs in Panama today are in the informal market, with unemployment nearing 10 percent.
A third of the rural population lives in poverty.
At the same time, the Panama Canal that sustains the economy and moves about six percent of the world's maritime trade, has had to limit traffic amid a crippling drought.
Another headache awaiting the newcomer is the Darien Gap between Colombia and Panama through which more than half a million undocumented migrants passed last year -- subjected to abuses criticized by rights groups.
Mulino has vowed to close the gap.
Some three million of Panama's 4.4 million citizens are eligible to participate in the single-round vote, with a simple majority required for victory.
They will also elect a new National Assembly.
Polls open for eight hours from 07:00 am local time (1200 GMT).