By Gene Palumbo and Elisabeth Malkin, for The New York Times
SAN SALVADOR — Salvadorans elected Nayib Bukele, the media-savvy former mayor of the capital, as their next president on Sunday, delivering a sharp rebuke to the two parties that emerged from the country’s brutal civil war in the 1980s and have held power ever since.
The dramatic win for Mr. Bukele, 37, who was running as an outsider, underscores the deep discredit into which the country’s traditional parties have fallen. Voters appeared to be willing to gamble on a relative newcomer to confront the country’s poverty and violence, shutting out the right- and left-wing parties that have dominated Salvadoran politics for three decades.
Mr. Bukele won almost 54 percent of the vote in preliminary results, the electoral board said, beating out Carlos Calleja, a supermarket executive who was the conservative Arena Party candidate. Hugo Martínez, a former foreign minister who ran for the governing Farabundo Martí National Liberation Front, or F.M.L.N., saw many of his party’s voters defect to Mr. Bukele and came in a distant third.
“Today we have turned the page on the postwar period,” Mr. Bukele said, appearing in blue jeans and his trademark leather jacket to declare victory.
Attacks from both the left and the right seemed to have little effect on Mr. Bukele’s popularity, which was driven by a social media campaign portraying him as a reformer willing to take on the ossified political establishment.
The conservative Nationalist Republican Alliance, known as Arena, was founded in 1981 by the extreme-right leader Roberto D’Aubuisson, who was accused of organizing death squads during the civil war. During its two decades in government, Arena recast itself as a business-friendly party, although it has never disowned its founder.
The F.M.L.N. is the party of the leftist guerrillas who put down their arms after peace accords were signed in 1992 and won the presidency in 2009. Although poverty rates have fallen somewhat during the past decade, two successive F.M.L.N. governments have struggled to deal with soaring street gang violence.
Mr. Bukele held out the promise of change after 30 years, said Roberto Cañas, a political scientist at José Simeón Cañas Central American University.
“It isn’t for his program, nor for his speeches,” Mr. Cañas said. “It is because they are tired, angry, fed up with corruption, sick of broken promises — and what they see in him is that he does not represent all that.”
Analysts said the three main candidates’ proposals differed little, but Mr. Bukele was able to set himself apart on the issue of corruption, which has roiled politics across Latin America and paved the way for candidates promising to combat it.
In El Salvador, both traditional parties made for easy targets.
Former President Tony Saca, an Arena politician, is serving a 10-year prison sentence after he pleaded guilty last year to charges of embezzlement and money laundering in the diversion of more than $300 million in public funds.
Mauricio Funes, a former television broadcaster who was the F.M.L.N.’s first president, is accused of embezzling $351 million. In 2016, he fled to Nicaragua, which has granted him asylum.
“In the popular imagination, the left was decent even though it was not a good administrator,” said Salvador Samayoa, a former F.M.L.N. leader who is now an independent consultant. The Funes case, he said, led to the perception that the party was neither.
Mr. Bukele made attacks on corruption a centerpiece of his campaign, running on the slogans “Give us back what was stolen” and “There is enough money when nobody steals it.”
He has proposed that El Salvador adopt a version of the international anticorruption commission that has been active in neighboring Guatemala for more than a decade, although he has offered few details.
Mr. Bukele’s outsider status is relatively new. He was mayor of San Salvador for the F.M.L.N. until he was expelled from the party in 2017 over his outspoken criticism of it. Looking for a vehicle for his campaign, he joined forces with a small right-wing party, the Grand Alliance for National Unity, known as Gana.
He has been carefully cultivating his social media presence since the beginning of his political career six years ago, said Amparo Marroquín, a professor of communication and culture at the Central American University.
The videos on Mr. Bukele’s Facebook page alternate between packaged clips showing him speaking before large crowds and awkward appeals from his living room, where he sits on an off-white sofa in front of a giant abstract painting.
He spent little time traveling the country, did not turn up for candidate debates and avoided interviews with journalists who might challenge him, leading critics to suggest that he was intolerant.
“There is a perception of a person who is arrogant, authoritarian, who doesn’t expose himself to dialogue,” said Alvaro Artiga, a political science professor at the Central American University.
As mayor of San Salvador, Mr. Bukele helped redevelop the historic center, sponsor a children’s orchestra and build a library, all popular projects among voters. But he avoided taking on projects that might have entailed a political cost, such as controlling the city’s snarled traffic or introducing a recycling program, Ms. Marroquín said.
As a candidate, he proposed grand infrastructure projects, including a train along the Pacific Coast and a new airport, without explaining how they would be paid for.
Mr. Calleja, 42, his Arena opponent, is an executive in his family-owned supermarket chain, though he has never held elective office. He promised to create 300,000 jobs, although he was vague as to how he would pay for his proposals.
All of the candidates said they wanted to maintain good relations with the United States, despite friction over El Salvador’s severing of diplomatic ties to Taiwan in favor of China and the Trump administration’s efforts to end a program that allows 250,000 Salvadorans to live legally in the United States.
Beyond issues of corruption and the economy, security concerns dominated the race. Homicide rates have declined from their peak in 2015, but El Salvador remains one of the most violent countries in the world outside war zones. The candidates said they would emphasize prevention programs in contrast to the current government’s tactics, which have focused more on cracking down on street gangs.
Analysts say those proposals indicate a recognition that the gangs have become political forces, able to command votes and use violence for political gain. The two main parties, as well as Mr. Bukele, have negotiated with the gangs.
Voters want to hear candidates take a tough stand against the gangs, which are considered the “mother of all evils,” Ms. Marroquín said. But the candidates “have realized that the gangs are an actor that can define an election.”