Image copyright AFP Image caption Jair Bolsonaro declared his candidacy to his cheering supporters at a rally in Rio de Janeiro

A controversial far-right politician, Jair Bolsonaro, has formally declared that he is running in Brazil's presidential election in October.

The former army officer is currently in second place in the polls behind ex-President Luiz Inácio Lula da Silva.

But Lula is in jail for corruption and is unlikely to be able to run.

Mr Bolsonaro has outraged many in Brazil with racist and homophobic comments. But his backers see him as a saviour in a crime-ridden country.

Mr Bolsonaro is followed by millions of Brazilians on social media, and many refer to him as the "Brazilian Trump".

Racism investigation

In 2011, he told Playboy magazine that he would be "incapable of loving a gay son" and that he would rather see such a son of his "die in an accident".

In 2015, he was fined for saying in a newspaper interview that Congresswoman Maria do Rosario was "not worth raping; she is very ugly".

He is currently being investigated for alleged racism over derogatory remarks he made about Afro-Brazilians.

Mr Bolsonaro, 63, declared himself a candidate to about 3,000 cheering supporters at a rally in Rio de Janeiro.

The congressman said he would be represented by the Social Liberal Party (PSL) - seen as a lightweight in Brazilian politics.

This means he will have less than 10 seconds of air time for his TV campaign ads - a serious handicap in the presidential race.

"We don't have a big party. We don't have election funding. We don't have television time," Mr Bolsonaro said.

"But we have what the others don't have, which is you, the Brazilian people."

The candidate, who advocates loosening the country's gun control laws to deal with crime, is backed by millions of evangelical Christians for his uncompromising anti-abortion stand.

Opinion polls suggest he is ahead if Lula is banned from running.

But some surveys suggest that while many Brazilians see him as the man to take control of crime and corruption, he also has a high rejection rate which could make it tricky for him to win if the vote were to go into a run-off.