Bukele, a businessman and former mayor, had to search for a new political home after being ejected in 2017 from the FMLN for a allegedly breaking party rules. In his last days as mayor of the capital, San Salvador, last year, Bukele tried and failed to create his own party. He then joined a center-left party, only to see it shut down by El Salvador's electoral tribune. Finally, he aligned himself with the Great National Alliance (GANA), a conservative party.
The third try proved to be the charm. Bukele won 53 percent of votes in Sunday's presidential election, sweeping to victory in the first round on the strength of his vigorous use of social media and promises to modernize government and tackle problems like corruption plaguing the Central American country.
His victory ended the reign of the two parties that had dominated El Salvador since the end of its vicious civil war in 1992 - the FMLN, a former rebel movement that entered politics after the civil war, and the conservative Nationalist Republican Alliance (ARENA).
El Salvador has a large Palestinian community of at least 100,000 people. Bukele's grandparents were born in Bethlehem and Jerusalem, and moved to Central America at an early age. His grandparents were Christians, although one converted to Islam.
Bukele's unconventional path to the presidency reflects the new approach the country's youngest-ever president-elect aims to bring to governing after he assumes office in June.
"He is able to think about solutions to problems in creative ways," Bertha de Leon, Bukele's friend and lawyer, said in an interview. "He may not necessarily be right, but that's something valuable in a leader - offering proposals that nobody has raised."
Whirlwind political career
Bukele, an entrepreneur, is a self-professed fan of US television series such as the political thriller "House of Cards" and legal drama "Billions."
He and his wife, ballerina Gabriela Rodriguez, just finished watching "The Good Wife," a US series that aired from 2009 to 2016 about the wife of a disgraced politician, Bukele told local media. Bukele, who did not respond to requests for comment, made his political debut in 2012 as mayor of Nuevo CuscatlÃ¡n, a small coffee-growing town outside the capital. With limited resources and little media attention, he used social media to draw attention to his work.
He then served as mayor of San Salvador from 2015 to 2018, where he rose to prominence by championing social causes and donating his salary for scholarships.
With slicked-back hair and a thick beard, Bukele refused to give interviews or participate in debates, saying the events would be stacked against him.
Instead, he engaged with his supporters on social media, urging them to share their thoughts on how to tackle corruption.
Bukele ran on an anti-corruption platform, but he has not been free of scandal allegations himself.
He has been accused of plagiarizing parts of his government platform. He is also under investigation for alleged money laundering and fraud during his time as mayor of San Salvador and Nuevo CuscatlÃ¡n.
Bukele has not commented on the money-laundering allegation but denies the other accusations.