(Updates voting tally, adds scene at Bukele's hotel)
SAN SALVADOR, Feb 3 (Reuters) - Salvadoran presidential hopeful Nayib Bukele, a former mayor campaigning as an anti-corruption outsider, was on track to win a first-round victory in Sunday's presidential election, according to early results from the electoral tribunal.
Bukele had 52 percent of votes with returns counted from 34.4 percent of polling stations, the electoral tribunal said at 8.30 p.m. local time (0230 GMT Monday), three-and-a-half hours after polls closed. It was not immediately clear when a definitive result would be available.
Bukele needs more than 50 percent of votes to win the presidency outright, bringing an end to the two-party system that has governed the tiny country of 6.5 million people for three decades.
Bukele, 37, has capitalized on the anti-establishment feeling sweeping elections across the region and further afield, as voters seek an alternative to traditional parties.
Since the end of its bloody 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.
"The two groups that created the war still want to keep governing, and what's more, they're corrupt," Bukele told reporters after voting in the capital.
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.
Pollster Mitofsky found in a January poll that Bukele had 57 percent of voter support, while a poll by Gallup showed him with 42 percent. Both polls showed ARENA's Carlos Calleja in second place.
A runoff, is there is one, would be held in March.
El Salvador's next president will face President Donald Trump's criticism of Central American governments for not doing enough to prevent migration to the United States. He will also have to manage an American backlash against El Salvador's recent establishment of diplomatic relations with China.
At home, the new government will have to try to kick-start a sluggish economy, combat corruption and tackle one of the highest homicide rates in the world.
Some voters said they were skeptical that Bukele has the experience to govern. Others said a third-party candidate is the only option for dramatic change.
"We had 20 years eating trash with ARENA, and 10 years with the Front. We have to vote for something different, and something different is this kid Nayib," said driver Oscar Rosales, 46, a former FMLN supporter who voted at a school in the city of Santa Tecla, outside the capital.
Entire families turned up at polling stations to vote, from parents with their children to older people in wheelchairs, in a calm atmosphere presided over by police.
'CORRUPT CAN'T HIDE'
Bukele, who was San Salvador mayor between 2015 to 2018, wants to 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, who has a large social media following, 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)