UPDATE 8-Outsider wins El Salvador presidency, breaking two-party system

(Recasts with Bukele victory declaration; adds background)

SAN SALVADOR, Feb 3 (Reuters) - A former mayor campaigning on an anti-corruption ticket swept to victory in El Salvador's presidential election on Sunday, bringing an end to a two-party system that has held sway over the violence-plagued Central American country for three decades.

Nayib Bukele, the 37-year-old former mayor of the capital, San Salvador, won 54 percent of votes with returns counted from 44 percent of polling stations. His two rivals from mainstream political parties conceded defeat.

Electoral authorities said they would declare definitive results within two days.

Bukele must now contend with U.S. President Donald Trump's frequent threats to cut aid to El Salvador - as well as neighboring Guatemala and Honduras - if they do not do more to curb migration to the United States.

"Today, we won in the first round and we made history," Bukele said in a victory speech to cheering supporters in the capital, after turning to snap a selfie with the crowd.

"We've turned the page on power."

Bukele, who was mayor from 2015 to 2018, capitalized on the anti-establishment feeling sweeping elections across the region and further afield, as voters seek an alternative to traditional parties.

Gang violence has made El Salvador one of the world's most murderous countries in the past few years, driving Salvadorans to flee to the north.

Among his campaign promises, Bukele, an avid social media user who often sports a black leather jacket, said he would push infrastructure projects to limit such migration.

Since the end of its civil war in 1992, El Salvador has been governed by the ruling leftist Farabundo Marti National Liberation Front (FMLN) and its rival, conservative Nationalist Republican Alliance (ARENA).

Though he describes himself as from the left and was expelled from the FMLN, Bukele has formed a coalition including a right-wing party that together has just 11 seats in the legislature.

Outside of the hotel in San Salvador where Bukele waited for the results, a group of supporters set off fireworks, beat drums and danced as early figures came in.

"Yes, we did it! Yes, we did it!" they chanted.

FMLN candidate Hugo Martinez conceded defeat shortly after Bukele's victory speech while ARENA candidate Carlos Calleja said he recognized the election results and would call Bukele to offer congratulations.

It was not immediately clear when the electoral tribune would complete counting all ballots.

'CORRUPT CAN'T HIDE'

Besides challenges on the international stage, once Bukele takes office in June, he will face a sluggish economy and rampant poverty.

He wants to modernize government and create an international anti-corruption commission with the support of the United Nations, following similar committees in Guatemala and Honduras.

"We'll create a (commission) ... so that the corrupt can't hide where they always hide, instead they'll have to give back what they stole," Bukele said in January.

Growing up, Bukele's relatively wealthy family was sympathetic to the FMLN, the former leftist guerrilla army that became a political party at the end of the civil war.

But Bukele has turned away from Latin America's traditional left, branding Venezuelan leader Nicolas Maduro and Nicaragua's Daniel Ortega as well as conservative Honduran Juan Orlando Hernandez as dictators.

"A dictator is a dictator, on the 'right' or the 'left'," Bukele wrote last week on Twitter. (Reporting by Nelson Renteria and Noe Torres; Writing by Christine Murray and Daina Beth Solomon; Editing by Rosalba O'Brien and Sonya Hepinstall)