In dramatic swing right, Jair Bolsonaro wins Brazil's presidential election

Former army captain Jair Bolsonaro won Brazil's presidential election on Sunday, riding a wave of frustration over corruption and crime that brought a dramatic swing to the right in the world's fourth-largest democracy, official results show.

Far-right candidate rode a wave of frustration over corruption and crime

Jair Bolsonaro waves after voting in the presidential runoff election in Rio de Janeiro on Sunday. (Silvia izquierdo/Associated Press)

Far-right lawmaker Jair Bolsonaro won Brazil's presidential election on Sunday, promising to clean up politics, shrink the state and crack down on crime, in a dramatic swing away from the left in the world's fourth-largest democracy.

The former army captain, with close ties to the military, has alarmed many with pledges to sweep political opponents off the map and comments denigrating women, gays and racial minorities. In his first public comments after a landslide victory, he vowed to respect democratic principles.

An outspoken admirer of U.S. President Donald Trump, Bolsonaro also pledged a smaller government and to realign Brazil with more advanced economies, overhauling diplomatic priorities after nearly a decade and a half of leftist rule.

Bolsonaro won 55.2 per cent of votes in a run-off election against left-wing hopeful Fernando Haddad of the Workers Party's 44.8 per cent, according to electoral authority TSE.

"We cannot continue flirting with socialism, communism, populism and leftist extremism ... We are going to change the destiny of Brazil," Bolsonaro said in an acceptance address, promising to root out graft and stem a tide of violent crime.

Thousands of Bolsonaro supporters cheered and set off fireworks outside the president-elect's home in Rio de Janeiro. (Leo Correa/Associated Press)

The 63-year-old congressman's rise has been propelled by rejection of the leftist Workers Party 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.

Thousands of Bolsonaro supporters cheered and set off fireworks outside his home in Rio de Janeiro's beachfront Barra de Tijuca neighbourhood as his victory was announced. In Brazil's commercial capital of Sao Paulo, Bolsonaro's win was greeted with fireworks and the honking of car horns.

"Brazil is partying. Brazil's good people are celebrating," said Carmen Flores, local president of Bolsonaro's PSL party.

Govern according to Bible

Many Brazilians are concerned that Bolsonaro, an admirer of Brazil's 1964-1985 military dictatorship and a defender of its use of torture on leftist opponents, will trample on human rights, curtail civil liberties and muzzle freedom of speech.

In his acceptance speech, he promised to govern according to the Bible and the country's constitution.

The live broadcast of his speech was preceded by a prayer led by lawmaker, pastor and gospel singer Magno Malta, underscoring Bolsonaro's ties to evangelical churches that backed him for his pledge to defend Christian values, including his stance against abortion.

Haddad supporters react in Rio de Janeiro. Many Brazilians are concerned that Bolsonaro will trample on human rights, curtail civil liberties and muzzle freedom of speech. (Sergio Moraes/Reuters)

Bolsonaro said he would "unite Brazil" by cutting bureaucracy and freeing up businesses to prosper. He said he was committed to fiscal discipline and called for the early elimination of the federal government's budget deficit.

"We are going to think in terms of more Brazil and less Brasilia," he said referring to the nation's capital.

The president-elect said he would shift Brazil's foreign policy towards a focus on relations with developed industrial nations that he said could offer Brazil technology to add value to its economic output.

Haddad supporters dressed in red react to a Bolsonaro supporter in yellow in Rio de Janeiro on Sunday. (Sergio Moraes/Reuters)

The seven-term congressman has vowed to crack down on crime in Brazil's cities and farm belt by granting police more autonomy to shoot at criminals. He also wants to let more Brazilians buy weapons to fight crime.

Voting was calm and orderly across the country, said Laura Chinchilla, the former president of Costa Rica who is head of the Organization of American States' Electoral Observation Mission. Brazil has suffered a spate of partisan violence during the polarized campaign.

Several hundred PT demonstrators protested Bolsonaro's victory on Sao Paulo's main Paulista Avenue before police dispersed them using tear gas.