Leftist Mauricio Funes of El Salvador's former Marxist rebel FMLN party has won the country's presidential election.
He defeated his conservative rival, the Arena party's Rodrigo Avila, who has admitted defeat.
Arena had won every presidential election since the end of El Salvador's civil war 18 years ago.
Addressing jubilant supporters, Mr Funes said it was the happiest day of his life and the beginning of a new chapter of peace for the country.
Branded by his opponents as a puppet of Venezuala's President Hugo Chavez, Mr Funes vowed to respect all Salvadorian democratic institutions.
The FMLN won 51.3% of the vote against Arena's 48.7%, Reuters news agency reported.
Break with tradition
"This is the happiest night of my life, and I want it to be the night of El Salvador's greatest hope," said Mr Funes.
Mauricio Funes is the first FMLN leader who has not been a combatant"I want to thank all the people who voted for me and chose that path of hope and change."
His FMLN (Farabundo Marti National Liberation Front) party was founded by Marxist guerrilla fighters from the civil war.
The conflict ended in a UN-sponsored peace accord in 1991, after the loss of some 70,000 lives over less than two decades.