(CNN) -- Mauricio Funes, a member of a political party that waged guerrilla war against the government 17 years ago, claimed the presidency of El Salvador on Sunday night.
FMLN's Mauricio Funes shows his ballot before voting Sunday in Antiguo Cuscatlan, El Salvador.
"This is the happiest night of my life," Funes told a jubilant crowd at his election headquarters. "It's also the night of greatest hope for El Salvador."
With 90.68 percent of the votes counted, the FMLN party's Funes had 51.27 percent, while the ARENA party's Rodrigo Avila had 48.73 percent, the country's Supreme Electoral Tribunal said.
The final tally will be certified within 48 hours, the electoral council's Walter Araujo said in a nationally televised news conference.
Funes' victory ended a 20-year hold on the presidency by the right-leaning ARENA.
"Now the ARENA party passes into opposition," Funes said. "ARENA ... can be assured that it will be listened to and respected."
Although polls had indicated the race had tightened considerably in the past few weeks, most analysts had predicted that Funes would win.
"It's a sign that there's democracy in that country, which is something the United States tried to foster," said Bernard Aronson, who as President George H.W. Bush's assistant secretary of state for inter-American affairs from 1989-93 was heavily involved in ending El Salvador's 12-year civil war.
The FMLN, which is the Spanish acronym for the Farabundo Marti National Liberation Front, was formed in late 1980 as an umbrella group for five leftist guerilla organizations fighting a U.S.-backed military dictatorship. The guerrillas and the government signed a peace pact in 1992 and the FMLN became a legitimate political party.
By some estimates, 75,000 Salvadorans died during the war.
The new president will find "a country that still retains a lot of bitterness, a lot of division," said Peter Hakim, president of the Washington-based Inter-American Dialogue policy institute.
"This country is completely divided," ARENA party official Adolfo Torres said on CNN affiliate TCS TV station Sunday night.
The election, Hakim said, was "an important test of how far El Salvador has come."
The result also will be an important test of how far El Salvador will go.
With an economy in deep trouble and neither party having enough seats to control the national Legislative Assembly, much will depend on the party that lost.
"Conflict occurs when one person wants to force a conflict," Hakim said. "Compromise requires both sides."
No one is certain how ARENA will handle the loss.
"That's a big unknown," said Heather Berkman, a Latin America analyst with the consulting firm Eurasia Group. "I still think they'll play ball. They have an incentive to get along with the new administration. They certainly don't want to be shut out of the process."
Otto Reich, who served in high-level Latin American posts for Presidents Reagan, George H.W. Bush and George W. Bush, sees the possibility of a spirited fight from ARENA.
"If I had to guess, I'd say ARENA will try to put democratic obstacles in the way of an FMLN consolidation of power," Reich said.
Although ARENA, which are the Spanish initials for the Nationalist Republican Alliance, has come back from a 14-point deficit in some polls two months ago, Reich said winning a fifth consecutive term was "swimming against the tide."
"People in El Salvador are weighing risks and opportunities," Reich said. "They have an opportunity to replace a party with which they have gotten tired."
Hakim also saw voter fatigue with ARENA, saying, "One party has managed the country forever and ever."
Many of the 2.4 million Salvadorans who voted weighed competing doubts.
"The uncertainty is that the FMLN has never been in power," Berkman said.
But voters also asked themselves, she said, whether they were "better off than they were five years ago, 10 years ago."
Avila, she said, could not run on a message of change. Funes' message of change and putting new people in power was more effective.
Since the war ended, Salvadorans have mostly supported ARENA because of concerns over the FMLN's left-wing agenda and the group's guerrilla background. There also have been outside influences.
"The country has been afraid to vote for the left because of fears from Washington," Larry Birns, director of the nonprofit Council on Hemispheric Affairs, said recently.
With the election of Barack Obama as president of the United States, Salvadorans may expect a different attitude from Washington.
El Salvador, Colombia and Peru have been the United States' closest allies in Latin America. Birns calls the three nations "Washington's street-corner guys."
With an FMLN victory, El Salvador joins other Latin American countries that have elected leftist leaders in recent years -- Venezuela, Bolivia, Nicaragua, Argentina, Honduras, Guatemala, Ecuador and Brazil.
But Berkman and others warn that the United States must not lump everyone together.
"People tend to look at the left in Latin America and oversimplify it," Berkman said. "There's the good left and the bad left."
Or as Aronson put it, "There's leftists, and there's leftists."
Aronson sees two types of leftist governments in Latin America: "institutional" governments like Brazil's that "have made peace with the free market" while still championing social programs, and populist, more-radical governments like Venezuela's.
Analysts are not sure what to make of Funes, a former freelance journalist for CNN en Español who is projecting a moderate image.
"The FMLN did something very clever," Reich said. "They put somebody at the head of the party who is not a guerrilla, not a terrorist."
Even the FMLN may not know what to expect from Funes. Berkman calls it "an issue of uncertainty" between the former journalist and the former guerrilla group.
"There's a lot of unknowns about how the relationship between Funes and the FMLN will proceed," she said, adding that she will watch his Cabinet picks and whether he brings in people from other parties.
Funes' victory was a defining moment for the FMLN.
"It's an important transformation," Hakim said. "The ex-guerrillas have to make a decision: Are they going to try to bring about revolutionary, radical change or manage the whole country and have step-by-step reform?"
Aronson sees it as "a test of whether they will be pragmatic or ideological."
The FMLN may not have a choice but to be pragmatic. The party holds 35 seats in the 84-member National Assembly. ARENA has 32 seats. Forty-three votes are needed to pass most legislation and some measures require "supermajority" approval of 56 votes.
That means that, if ARENA and the FMLN cannot agree on a measure, they have to look to one of the minor parties for support. The PCN, which is the National Conciliation Party, has 11 seats and could emerge as a power broker. Two others parties hold six seats.
"It is in the PCN's interest to play ball as well," Berkman said. "The PCN will act as a moderating force."
Berkman also said the FMLN will likely take a moderate approach because the nation relies too much on outside investments and remittances from Salvadorans living abroad for the former guerrillas to adopt too much of a radical approach.
But Hakim worries about something else.
"I think ARENA may be prepared for this [loss]," he said. "I'm concerned that the FMLN may not be prepared to govern."
All About El Salvador