El Salvador's electoral court on Thursday declared leftist party candidate and a former rebel commander Salvador Sánchez Céren the winner of the hotly contested presidential election.

With 100 percent of the votes counted, the electoral court announced on its website shortly after midnight that Sánchez Céren, the leftist candidate of the ruling Farabundo Marti National Liberation Front, the FMLN, got 50.1 percent of the votes. Norman Quijano, of the Conservative Nationalist Republican Alliance party, known as ARENA, got 49.9 percent support in Sunday's runoff.

With about three million ballots cast in Sunday's runoff presidential election, Sánchez Céren won by less than 7,000 votes.

He is the first former rebel commander to win the presidency in the Central American nation. Outgoing President Mauricio Funes was a journalist who was sympathetic to the FMLN rebels during the civil war but was never a guerrilla.

The once long-ruling ARENA lost the presidency to Funes in 2009 after two decades in power.

Sánchez Céren, 69, and his supporters celebrated their victory at a hotel in downtown San Salvador but shortly after the announcement he urged them to go home and stay calm.

"This is a very exciting moment, but also a moment of commitment for the FMLN," said Lorena Pena, an FMLN congresswoman. "We will be fully committed with the people."

Quijano, 67, has said he will dispute the results because he alleged there was fraud in the vote. He has presented no evidence so far. ARENA party leaders have said they will continue taking to the streets to demand a recount.

Quijano has been organizing Venezuela-style protests and called on the army to defend against the alleged fraud, but the defense minister, Gen. David Munguia Payes, and the army's top commanders said at a news conference Wednesday that they're staying out of the dispute.

"We are committed to respecting the official results that are issued by the Supreme Electoral Tribunal," Munguia Payes said. "We repeat that we are committed to strictly respecting the sovereign decision that the people of El Salvador expressed at the ballot box."

Quijano's suggestion of military intervention had called up echoes of the country's 1980-92 war, when 76,000 people died in fighting between the military and leftists rebels of the FMLN. After peace accords ended the conflict in 1992, the FMLN turned into a political party.

Sánchez Céren campaigned on a promise to deepen the outgoing government's popular social programs and govern as a moderate. He said he envisioned ruling like Uruguayan President José Mujica, also a former guerrilla who formed an inclusive government.

Sánchez Céren was a top rebel commander who helped negotiate the peace accords that ended El Salvador's civil war, in which the United States supported the government against the FMLN to prevent communism from spreading in Latin America.

Quijano said Wednesday that electoral authorities didn't allow several of his campaign advertisements to run and charged that members of the FMLN were allowed to vote twice, but presented no evidence to back up his claims.

In addition to charging fraud, Quijano claims the electoral tribunal favors the FMLN.

His supporters have demanded a vote-by-vote recount. Authorities only recounted votes at about 21 polling places, which wouldn't be enough to alter the final results.

El Salvador has one of the highest murder rates in the world. A 2012 gang truce seemed to cut the country's daily average of 14 dead by half, but the drop appears to have been short-lived.

Homicides, mostly of gang members, have risen again this year. Police statistics show 501 murders the first two months of this year, an increase of over 25 percent over the same period of 2013. More unsettling is the fact that many dead have turned up in mass graves, leading some to believe the gang truce could have been either an illusion or an agreement to cover up the violence.