* Leftist ex-rebel had 6,364 vote advantage in final recount
* Right-wing challenger files to annul election
* May take days to process legal challenge - tribunal (Adds details on Sanchez Ceren, comments from voters and analyst)
By Michael O'Boyle and Nelson Renteria
SAN SALVADOR, March 13 (Reuters) - A former Marxist guerrilla leader won El Salvador's presidential election by less than 7,000 votes, final results showed on Thursday, and his right-wing rival continued to press to have the vote annulled.
Salvador Sanchez Ceren of the ruling Farabundo Marti National Liberation Front (FMLN), which as a militant group fought a string of U.S.-backed governments in a 1980-1992 civil war, won 50.11 percent support in Sunday's vote, results showed.
Challenger Norman Quijano, the 67-year-old former mayor of San Salvador and candidate of the right-wing Nationalist Republican Alliance (Arena) party, had 49.89 percent support. He has filed a claim to annul the election due to fraud.
The electoral tribunal's president, Eugenio Chicas, said the five-member court unanimously validated the election results, showing that Sanchez Ceren beat Quijano by 6,364 votes.
"We make an invitation to build for the future, because the FMLN's presidential ticket, now elected to lead the country, is going to work to unite the country," Sanchez Ceren said.
Due to the ongoing dispute, the tribunal said it could take until Sunday or Monday to work through Quijano's legal challenge to the election and settle any remaining doubts.
Quijano said on Wednesday he had proof that 20,000 people had voted twice, but refused to share evidence with media. International observers said they had seen no evidence of widespread fraud.
"We don't see any basis for the accusations," said Dieter Druessel, a Swiss election observer. "They talk about 20,000 votes, but ultimately they aren't presenting anything."
Sanchez Ceren, who would be the first ex-rebel to become president if he takes over from incumbent Mauricio Funes, has promised to make a "national pact" with conservative parties and business owners, and to establish a moderate government.
Quijano has tried to paint him as a radical in disguise who would bow to the influence of socialist Venezuela.
Sanchez Ceren is a devout Catholic who has taken a pragmatic approach toward attracting private investment to El Salvador. He has also steered away from backing leftist policies such as legal abortion, gay marriage or the legalization of marijuana.
That did not stop many right-leaning voters expressing reservations about having a former guerrilla in office, and the result was much closer than polls had anticipated.
The country's civil war killed 75,000 people, and polarization between the right and left still runs deep.
"I do not trust him because he was a guerrilla commander," said Emelina Hercules, a 62-year-old seamstress. "They want to maintain power like dictators."
The ninth son of a carpenter, Sanchez Ceren became a rural school teacher before joining the FMLN guerrillas. He rose to lead one of its five main factions in the war, though supporters say he was less ideological than some of his comrades.
"He was a militant, but in reality he fought for the needs of the people," said engineer Diego Marin, 26. "He can deliver a better future for the country."
Arena attacked Sanchez Ceren using videos of recent protests in Venezuela against President Nicolas Maduro, suggesting El Salvador could end up in a similar situation if the left won.
Sanchez Ceren, who previously led the FMLN in Congress, blew off the attacks and vowed to build consensus with conservatives.
His efforts were seen as crucial in pushing through Congress last year a law allowing tie-ups between public and private companies. As a founding father of the FMLN, some analysts think he could be a more effective leader than Funes, who struggled to convince ex-rebels to support business-friendly plans.
"He has a very strong control of his party and the members of Congress from his party," said Standard & Poor's credit analyst Joydeep Mukherji. (Reporting by Michael O'Boyle and Nelson Renteria; Editing by Louise Ireland, Leslie Adler and Richard Chang)