A far-right candidate, Jair Bolsonaro, has won the first round of Brazil’s presidential election.
He will face the left-wing Workers’ Party candidate, Fernando Haddad, in the second round on 28 October after he failed to win the 50% of valid votes needed to win outright.
With almost all the votes counted, Mr Bolsonaro had 46% and Mr Haddad 29%.
Opinion polls conducted before the election predicted that in a second round the two candidates would be tied.
Mr Bolsonaro’s once insignificant Social Liberal Party (PSL) is poised to become the largest force in Congress following legislative elections held alongside the presidential vote, in what analysts have described as a seismic shift in Brazilian politics.
The politician and the PSL have ridden a wave of rising anger at the Workers’ Party, which their supporters blame for a prolonged recession, rising violent crime and widespread corruption in South America’s largest economy.
In his victory speech, broadcast live on Facebook and uploaded on to Twitter, he said Brazilians could take the path of “prosperity, liberty, family, on God’s side” or the path of Venezuela.
Brazil’s socialist-led neighbour is mired in a deep economic and political crisis which has driven more than two million people to leave.