Updated

El Salvador and Costa Rica held presidential elections Sunday widely viewed as referendums on political stagnation, and it appeared both Central American nations might need to hold runoff ballots.

The ruling leftist party in El Salvador was fighting to hold on to the presidency after only one term, with critics saying the government of President Mauricio Funes did little to energize a sluggish economy and reduce gang crime. In Costa Rica, the ruling conservative party was in a tough battle weighed down by corruption allegations.

El Salvador's electoral tribunal said late Sunday that with about 58 percent of the votes counted, Vice President Salvador Sanchez had 49 percent in his bid to extend the rule of the Farabundo Marti National Liberation Front, the party of former civil war guerrillas that won the presidency for the first time in 2009.

Sanchez was just under the 50 percent plus one vote he needed to win outright, but election tribunal chief Eugenio Chicas predicted the candidate would fall short and have to face a runoff. San Salvador Mayor Norman Quijano was second with nearly 39 percent as the candidate of the long-governing conservative Nationalist Republican Alliance, known as ARENA.

In Costa Rica, election officials said that with 61 percent of polling stations reporting, governing National Liberation Party candidate Johnny Araya was running neck-and-neck with Luis Guillermo Solis of the Citizen Action Party. Solis held a tiny lead, with each candidate having around 30 percent of the votes, leaving them far short of the 40 percent needed to avoid an April 6 runoff.

Funes, the former television journalist who is stepping down as Salvadoran president, won the support of the poorest sectors of his country by implementing social programs, including giving books, shoes and uniforms to school children, seeds and fertilizers to the poorest farmers and a small pension to the elderly.

"The people in rural areas, in marginalized sectors, people with lower levels of education were once the main political capital of ARENA, but they are now the FMLN's electoral stronghold," said Jeanette Aguilar, director of the Public Opinion Institute at the Central American University Jose Simeon Canas in El Salvador.

For Salvadorans, the main issues were a sluggish economy and rampant gang crime in the country of 6 million people.

Under Funes, leaders of El Salvador's main Mara street gangs declared a truce in several cities that yielded mixed results.

"Homicides have gone down but (the gangs) are still killing; now they hide the victims," said Roberto Rubio, director of the National Foundation for Development. "Extortion has intensified and gangs have solidified their control over territory."

In the last year, police have found mass graves containing the bodies of at least 24 alleged gang victims.

On top of the lack of security, Funes wasn't able to control the deficit or create jobs. But his poor handling of the economy might be not enough to bring back ARENA, said Omar Serrano at the Jose Simeon Canas university.

"The population is not satisfied with the current government, is not convinced that the FMLN should continue to rule, but it's very much convinced that ARENA shouldn't return to government," Serrano said.

In Costa Rica, the National Liberation Party was beset by infighting and corruption allegations. Araya, who has been the mayor of the capital of San Jose since 2003, also needed to overcome discontent over high unemployment during President Laura Chinchilla's government.

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino