Nicaraguan President Daniel Ortega, a former Marxist guerrilla leader, looks likely to win re-election on Sunday after heavy social spending won him strong support among the country's poor.
Ortega has overseen a period of economic progress in his five years in power, backed by financial aid from his socialist ally in Venezuela, President Hugo Chavez.
A former commander of the Sandinista rebel army that won power in a 1979 revolution and a Cold War adversary of the United States, Ortega has solidified his hold on the Central American country with programs to improve health and education, microcredits and gifts of livestock.
He has a strong poll lead over a conservative opposition whose two main candidates failed to unite against him.
Ortega was allowed to run for re-election thanks to a 2009 ruling by the Supreme Court, which is controlled by his Sandinista party.
Backed by Venezuela, Ortega has cut poverty in this largely agrarian nation, and is credited with allowing the private sector to operate freely. A recent CID-Gallup poll showed he was on course to win nearly half the votes in the election, well above what he would need to avoid a run-off vote.
He has helped the poor, other presidents didn't do that, said law student Wendy Gonzalez, 19, after casting her vote in a poor area of the capital Managua.
But Ortega is also criticized for undermining democratic institutions and some critics fear he aims to stay in power indefinitely like Chavez, whose petrodollars boost the Nicaraguan economy.
Ortega led Sandinista rebels in ousting the Somoza family dictatorship in the 1979 revolution and was the top figure in a government that withstood a U.S.-backed Contra rebellion throughout the 1980s.
He was elected president in 1984 but was voted out in 1990. He then spent 16 years as the main opposition leader before regaining power in a 2006 election.
How can Ortega call himself a revolutionary when he's a dictator? Roberto Betancourt, who has a farm on the outskirts of Managua, said at a polling station on Sunday. He has no principles, he's following in the footsteps of Somoza.
CHAVEZ SUPPORT KEY
Ortega has moderated his socialist rhetoric in recent years, although he is part of the Chavez-led bloc of left-wing governments in Latin America.
His relations with Washington remain tense and the U.S. government said it is concerned about irregularities ahead of the election, including difficulties some voters had to register and some domestic observers to get accreditation.
Ortega's main challengers are radio personality Fabio Gadea and former president Arnoldo Aleman. Yet both refused to step aside to avoid splitting the conservative vote.
To avoid a second round run-off, Ortega needs at least 40 percent of the vote on Sunday, or 35 percent and a five percentage point lead over his closest rival.
Ortega has pledged to extend anti-poverty programs that include giving cows, pigs and hens to rural families, and analysts say he has no need to rig the vote.
Poverty has fallen to 57 percent of the population from 65.5 percent in 2005, according to government and World Bank statistics. Despite that, Nicaragua is still second only to Haiti as the poorest country in the Western Hemisphere.
Ortega's prospects might not look so bright if it were not for the support from Chavez, which analysts estimate brings in as much as $500 million a year, or 7 percent of gross domestic product.
The deal with Venezuela grants Nicaragua preferential access to oil, allowing it to weather price spikes that have hit poor neighbours like Honduras.
(Additional reporting by Alex Leff and Sean Mattson; Editing by Kieran Murray)