A former television journalist who has compared himself to President Barack Obama has given El Salvador's former guerrillas their best chance to win the presidency since a bloody civil war ended in 1992.

If Mauricio Funes wins Sunday's election, he would extend a string of leftist victories in Latin America and uproot two decades of conservative Salvadoran governments that have been steadfast U.S. allies. He would also be the first leftist Latin American leader elected since Obama took office, giving him a unique opportunity to build relations on a fresh note.

Funes said Thursday he was confident he would have good relations with Obama: "I trust his sense and different vision of Latin America."

Funes, of the Farabundo Marti National Liberation Front, faces Rodrigo Avila, an FBI-trained former national police chief running for the conservative ruling party, Arena. Most polls show Funes ahead of Avila, though many voters remain undecided.

The election comes at a time of uncertainty over how Obama will approach the region, where populist and socialist governments govern most nations. Former President George W. Bush was broadly unpopular, although Washington was still on good terms with moderate leftist governments in countries like Brazil, Chile and Uruguay.

Even Venezuela's fiery Hugo Chavez and his allies have expressed hope for better ties with Obama, though they haven't blunted the anti-U.S. tone of their speeches.

Central America recently joined the swing to the left. Honduran President Manuel Zelaya has allied himself with Chavez, as has Nicaragua's Daniel Ortega, a former Marxist who returned to power in 2007 after spending the 1980s fighting U.S.-backed Contra rebels. Alvaro Colom last year became Guatemala's first leftist president in more than 50 years.

Avila, 43, has played on fears of a leftist government in a country still healing wounds from a 12-year civil war that left 75,000 people dead. He warns that a Funes victory would send El Salvador down a communist path and bring it under Chavez's domination.

Funes supporters dismiss such warnings as time-worn scare tactics designed to distract voters from a growing crime rate and rising food and fuel costs.

"The war is over," said retired Col. David Munguia, who leads a group of 100 military officers who have thrown their support behind Funes in an unprecedented alliance. "We cannot change our past, but we can build a future together."

The campaign has turned vicious in the last days, with street skirmishes breaking out between supporters of each candidate. On Wednesday, Avila accused Funes supporters of attacking his campaign caravan with stones.

"They are not prepared to govern. They are the same as criminals," he told reporters, standing in front of two SUVs with shattered front windows.

The Front plucked Funes, 48, from outside its ranks in hopes of overcoming its rebel image 17 years after laying down arms and becoming a political party as part of peace accords.

Funes, who left a career in television journalism to join the party, has been determinedly moderate, promising to fight corruption and tax evasion. He says he will not abandon El Salvador's use of the U.S. dollar as its currency and pledges to respect the Central American Free Trade Agreement with the United States.

He has said Obama has kindled hopes for good relations with a leftist-led El Salvador. In campaign ads, Funes even compared his message to Obama's promise of change.

That earned him a rebuke from the U.S. Embassy for using Obama's image in the campaign, but the scolding was mild compared to comments from U.S. officials during past elections clearly favoring Arena's candidate.

El Salvador has remained a bastion of U.S. support under President Tony Saca, who is constitutionally barred from seeking a second five-year term.

It was the last Latin American country to pull troops from Iraq, bringing them home last month. About 10 percent of the 2.5 million Salvadorans living in the United States have temporary work permits granted after a series of earthquakes in 2001.

That has helped keep remittances up even as they fall in neighboring countries amid global economic turmoil.

Avila, who worked closely with U.S. officials as vice minister of security and national police chief, casts himself as El Salvador's best hope for staying on good terms with Washington.

He has also pledged to redress social inequalities that partly fueled the civil war and are pushing the Front's comeback. He has promised to build 50,000 subsidized homes and create 250,000 new jobs.