An establishment leftist and a newcomer businessman appeared to capture the top two spots in Ecuador’s presidential election on Sunday in a campaign cycle that has centered on voters’ frustration with the country’s soaring gang and drug cartel violence.

Luisa González, who was backed by a former socialist president, and the political outsider Daniel Noboa received the highest percentage of ballots with 84 percent of the vote counted. They will compete in a runoff election on Oct. 15.

The economy and security are likely to be the leading issues going into the runoff, as local prison and street gangs, along with foreign drug mafias, have unleashed a wave of violence unlike anything in the country’s recent history, sending homicide rates to record levels and hurting the vital tourism industry.

Concerns over the declining security were amplified earlier this month when the presidential candidate Fernando Villavicencio was assassinated on the campaign trail.

Ms. González led the election, garnering 33 percent of the vote, with 84 percent counted, followed by Mr. Noboa, the unexpected second-place winner with 24 percent. Just a few weeks ago, Mr. Noboa was polling in single digits.

Full official results were expected later on Sunday night.

Sunday’s first-round vote followed President Guillermo Lasso’s call for snap elections in May amid impeachment proceedings against him over accusations of embezzlement, as well as rising voter dissatisfaction over the nation’s security crisis.

Ecuador, a country of 18 million, was once a tranquil haven compared with its neighbor Colombia, which for decades was ravaged by violence by armed guerrilla and paramilitary groups and drug cartels. As that changed in the past few years after Colombia forged a peace deal, the narco-trafficking industry grew increasingly powerful in Ecuador.

Amid news reports regularly featuring beheadings, car bombs, police assassinations, young men hanging from bridges and children gunned down outside their homes and schools, Ecuadoreans are hoping for new leadership that can restore the peaceful existence they once took for granted.

The González-Noboa matchup means that “there’s still a strong, loyal base for Correísmo that’s enough to get González into the runoff,” said Risa Grais-Targow, the Latin America director for Eurasia Group, referring to the leftist movement of former President Rafael Correa, who governed from 2007 to 2017.

But, she said, “there’s a large share of the population that really wants something completely different — they want a new face.”

The surprise of the night was the second-place victory for Mr. Noboa, who was recently polling toward the bottom of the pool of eight candidates.

“The youth opted for the Daniel Noboa option,” said Mr. Noboa in a news conference Sunday night. “It would not be the first time that a new proposal would turn around the electoral establishment,” he added, referring to himself.

The 35-year-old comes from one of the richest families in Latin America, known to most Ecuadoreans for its banana empire. His father ran for president five times, unsuccessfully, but the younger Noboa’s political career goes back only to 2021, when he was elected to Ecuador’s Congress.

“He has a voting base that is familiar with the Noboa brand, with the Noboa name, and that now has been very successfully energized, refreshed with a new face,” said Caroline Ávila, an Ecuadorean political analyst. “He captures the attention of young people, the main mass of undecided voters. They are the ones who are putting him in the second round.”

Mr. Noboa’s campaign seemed to take off only a week ago, when he impressed many Ecuadoreans with his debate performance.

“He stands out in the debate,” Ms. Ávila said. “He speaks well, he speaks fluently, without complicating himself too much, without fighting. And it has generated a lot of interest in these post-debate weeks.”

As a legislator and member of the National Democratic Action Movement, Mr. Noboa supported bills to attract international investment and cut taxes, said Grace Jaramillo, an Ecuadorean professor of political science at the University of British Columbia.

His policy proposals include pledges to create jobs, lower taxes, lower electricity bills and enter into more international free trade agreements.

“It’s a big surprise, especially in the fact that the debate did have an effect,” said Arturo Moscoso, Quito-based political scientist. But he added “For many Ecuadoreans he is an unknown.”

Mr. Noboa positioned himself as “the employment president,” even including an employment request form on his website, among other broad commitments to security and the economy. As a businessman and U.S. citizen who grew up in the United States, he is likely to favor American market-friendly interests, said Ms. Grais-Targow.

While analysts predicted security to be the main issue in the election following the assassination, Mr. Noboa’s success shows that in a country where just 34 percent of Ecuadoreans have adequate employment, according to government data, the economy is still top of mind.

One voter, Carlos Andrés Eras, 31, said he supported Mr. Noboa because he saw him as a well-prepared politician with clear proposals.

“It is not improvised, he has been putting together his political project little by little,” said Mr. Eras, who owns a jewelry store in Guayaquil. “He concentrated on giving his points and answered what was raised in the question without attacking anyone.”

Mr. Noboa came in just behind the leftist establishment candidate, Ms. González.

Backed by the powerful party of Mr. Correa, the former president, Ms. González, 45, has appealed to voter nostalgia for the economic and security situation under the Correa administration, when homicide rates were low and a commodities boom helped lift millions out of poverty.

“It is the first time in the history of Ecuador that a woman has obtained such a high percentage in the first round,” said Ms. González in her postelection speech. “We are going to have that homeland again with hope, with dignity, with security.”

Germán Montoya, a voter and the owner of a plastic company in Guayaquil, Ecuador’s largest city, said extortion payments demanded by gangs were hurting his business and had pushed him to vote for Ms. González.

“‘Mr. Montoya, I can’t go there, here, because they charge me a toll,’” he said his employees tell him. The trucks are charged $50 to make deliveries in different parts of Guayaquil, Mr. Montoya, 37, said.

Jordy Gonzales, a 23-year-old construction worker, felt similarly. Mr. Correa’s party, he said, “did things right, and we are going to see if this time, if God allows it, it will be like before.”

If Ms. González wins the election in October, it will show the staying power of Mr. Correa as a dominant political force in Ecuador despite being out of power for six years.

He has lived in Belgium since he left office, fleeing an eight-year prison sentence for campaign finance violations. But experts predict that in the event of a González victory, he would likely return to the country and try to seek office again before the next president’s tenure expires in May 2025.

Genevieve Glatsky reported from Bogotá, Colombia; José María León Cabrera from Quito, Ecuador; and Thalíe Ponce from Guayaquil, Ecuador.