President Guillermo Lasso called the snap election after he dissolved the opposition-dominated Congress in May to avoid an impeachment trial just two years after his election. AFP / Bryan R. Smith

Ecuador will hold a presidential election Sunday after a campaign marked by the murder of a top candidate and vows to tackle the lawlessness that has engulfed the once-peaceful nation.

The small South American country has in recent years become a playground for foreign drug mafia seeking to export cocaine from its shores, stirring up a brutal war between local gangs.

The murder rate has soared above that of Mexico or Colombia, and the assassination of several politicians in the run-up to the vote underscored the challenge facing Ecuador's leaders.

The most high profile among them was presidential candidate and anti-corruption crusader Fernando Villavicencio, gunned down in broad daylight as he left a political rally just days ahead of the vote.

"These are completely atypical elections, in a situation basically of horror that Ecuador is going through... due to the existing violence, but which manifested itself in a more acute and atrocious way" with Villavicencio's murder, political scientist Anamaria Correa Crespo told AFP.

Soldiers have been deployed across the country to secure the vote, which begins at 7:00 am local time (1200GMT) and closes at 5:00 pm (2200 GMT).

Initial results are expected to trickle in the same night, with ten days for a final tally to be announced.

President Guillermo Lasso called the snap election after he dissolved the opposition-dominated Congress in May to avoid an impeachment trial just two years after his election.

There are eight candidates in the running, with a runoff scheduled for October 15 if no one wins outright. The new president will take office on October 26, and will only serve for a year and a half.

Leading the polls before the murder was Luisa Gonzalez, 45, a lawyer from the leftist party of former president Rafael Correa.

Correa was sentenced to eight years in jail after an investigation by Villavicencio into corruption, and fled to Belgium where he has been living in exile for six years.

Analysts say Gonzalez's image has been tainted by allegations Correa was behind the murder -- which he was forced to deny.

Correa admitted the assassination had "shifted the electoral leaderboard."

Villavicencio, who was polling second before his murder, was replaced last-minute by another reporter, Christian Zurita.

"I am almost certain that he was assassinated because he said he would militarize the ports," Zurita told journalists Thursday, surrounded by armed police and private security guards.

"There is a transnational mafia behind his killing."

Political analysts say the candidate who has seen the biggest boost to his popularity is the 40-year-old right-wing businessman Jan Topic.

Nicknamed "Rambo," the former paratrooper and sniper with the French Foreign Legion has vowed to wipe out criminal gangs and build more prisons, emulating El Salvador's Nayib Bukele.

Other leading candidates are right-wing former vice-president Otto Sonnenholzner, and leftist Indigenous attorney Yaku Perez.

In one of the world's most biodiverse countries, two key referendums are taking place on Sunday alongside the election.

One will ask voters to choose whether to continue oil drilling in the Amazon, and another focuses on whether to forbid mining activities in the Choco Andino forest.

Ecuador was once seen as a haven of peace wedged between cocaine-producing nations Colombia and Pero.

The small country straddles the Andes and the Amazon, and was best known as the world's top exporter of bananas and home to the biodiverse Galapagos Islands where British scientist Charles Darwin developed his theory of evolution.

However in the past five years its large ports, lax security and corruption have lured foreign cartels that have come under increased pressure from the war on drugs in Mexico and Colombia.

In the capital Quito, factories kitting out armored vehicles have seen business boom as those who can afford it try to protect themselves.

A Gallop poll released earlier this year showed 62 percent of Ecuadorians felt unsafe -- the highest in Latin America.

In 2022 the country hit a record 26 murders per 100,000 inhabitants, higher than that of Colombia, Mexico and Brazil.