Jair Bolsonaro, a far-right former Army captain who won Brazil's presidential election in convincing fashion, has been congratulated by US President Donald Trump.

Mr Bolsonaro, who early in his legislative career declared he was "in favor" of dictatorships and demanded that Congress be disbanded, vowed on Sunday to adhere to democratic principles while holding up a copy of the country's Constitution.

US President Donald Trump said he had an "excellent call" congratulating Mr Bolsonaro and tweeted about their plans to "work closely together on Trade, Military and everything else!"

Markets also cheered Mr Bolsonaro's victory, sending Brazil's benchmark Bovespa stock index to an all-time high on his pledges to balance the federal budget and privatise state firms.

Mr Bolsonaro's win has alarmed critics around the globe, given his defense of Brazil's 1964-1985 military dictatorship, his vows to sweep away leftist political opponents, and a track record of denigrating comments about gays, women and minorities.

His victory brings Brazil's military back into the political limelight after it spent three decades in the barracks following the country's return to civilian rule.

Several retired generals will serve as ministers and close advisers.

"You are all my witnesses that this government will defend the constitution, of liberty and of God," Mr Bolsonaro said in a Facebook live video in his first comments after his victory.

The president-elect's future chief of staff told Reuters his first international trip would be to Chile, one of the South American neighbours that swung to the right in recent elections.

An outspoken Trump admirer, Mr Bolsonaro also vowed to realign Brazil with more advanced economies such as the United States, overhauling diplomatic priorities after nearly a decade and a half of leftist rule.

The 63-year-old former paratrooper joins a list of populist, right-wing figures to win elections in recent years such as Mr Trump, Philippine President Rodrigo Duterte and Hungarian Prime Minister Viktor Orban.

Mr Trump's friendly call augurs closer political ties between the two largest economies in the Americas - both now led by conservative populists promising to overturn the political establishment.

Bolsonaro supporters carried out several attacks in the run-up to Sunday's vote, in particular targeting Brazilian journalists, according to a tally kept by Abraji, an investigative journalism group.

Mr Bolsonaro himself was stabbed at a rally last month and will need to undergo surgery in mid-December.

He won 55.2% of votes in a run-off election against left-wing hopeful Fernando Haddad of the Workers Party (PT), who garnered 44.8%, according to electoral authority TSE.

His rise has been propelled by rejection of the leftist PT that ran Brazil for 13 of the last 15 years and was ousted two years ago in the midst of a deep recession and political graft scandal.

Brazil's currency, the real, gained around 10% against the dollar this month and interest rate futures have tightened dramatically as Bolsonaro's prospects improved.


Read: All you need to know about Brazil's divisive election