The homecoming of Brazil’s far-right presidential frontrunner Jair Bolsonaro from hospital was upstaged this weekend by huge demonstrations as concerns over his authoritarian tendencies grew.

Bolsonaro flew from São Paulo to his home in Rio de Janeiro on Saturday, three weeks after being stabbed during campaigning, while tens of thousands of women filled the streets in cities across Brazil to protest against his extremist positions ahead of the 7 October election.

The G1 news site reported anti-Bolsonaro protests in all Brazil’s 27 states grew out of a Facebook group called Women United Against Bolsonaro which nearly 4 million people have joined. Pro-Bolsonaro demonstrations took place in 16 states, the site said. The piauí magazine website called the demonstrations “historic” and printed a photo of an enormous crowd in São Paulo which organisers claimed half a million attended, though police did not provide an estimate.

Profile Who is Jair Bolsonaro? Show Hide Biography Born in Glicério in São Paulo in 1955 to parents of Italian descent, he served in the army from 1971 until 1988, when he was elected as a city councillor in Rio de Janeiro for the Christian Democratic party. In 1990, he became a federal congressman for the same party. He has since been affiliated with a number of political parties. On 22 July, he was officially nominated as the presidential candidate of the Social Liberal party. Policies Bolsonaro espouses populist and nationalist views that often stray into far-right territory. A vocal opponent of same-sex marriage, abortion, immigration and other progressive causes, he has defended the death penalty and the 1964-85 military dictatorship. On foreign policy, he has said he wants to improve relations with the US. Economically he says he is pro free market and privatisation. Political style Deliberately provocative and polarising. He has praised Gen Pinochet, expressed support for torturers and called for political opponents to be shot, earning him the label of "the most misogynistic, hateful elected official in the democratic world”. In his bid to capitalise on Latin America’s lurch to the right, he paints himself as a tropical Donald Trump: a pro-gun, anti-establishment crusader set on "draining the swamp" and cracking down on violent crime. Controversies On top of repeated calls for a return to dictatorship, he has made equally inflammatory attacks on women, black people, gay people, foreigners and indigenous communities. Earlier this year, he was charged by the attorney general with inciting hate speech. Support and first round victory Bolsonaro has a devout following among some conservative voters, who admire his promises to get tough on rampant violent crime, and won 46% of the vote in the election's first round. Photograph: Evaristo Sa/AFP

In Rio the huge crowds that filled the city centre were notable for their diversity – with women of all ages, many of whom had brought children, male and LGBT demonstrators, chanting “not him”, an anti-Bolsonaro hashtag that has become a campaign slogan shared by celebrities like Madonna.

Trump of the tropics: the 'dangerous' candidate leading Brazil's presidential race Read more

Many demonstrators expressed concerns over Bolsonaro’s declaration in a television interview on Friday that he would not accept any election result he did not win because of his endorsement of the military dictatorship which ran Brazil for two decades.

Facebook Twitter Pinterest Jair Bolsonaro sits on a plane at the airport in São Paulo. Photograph: STRINGER/Reuters

Flavia Carvalho, 40, a civil servant, carried a “not him” banner designed around an Adolf Hitler cartoon. “He is preaching fascism,” she said. Others said they were protesting against the sexist, racist and homophobic views Bolsonaro has expressed.

“He is sexist. He is misogynist. He is racist,” said Ana Paulo Gonçalves, 24, a teacher. “He wants to go back to the military dictatorship,” said her sister Christine, 29, a designer.

Bolsonaro, a former army captain and veteran lawmaker, currently leads polling for a first-round vote on 7 October. Running second is Fernando Haddad, a former mayor of São Paulo who took the place of formidably popular former President Luiz Inácio Lula da Silva after Lula’s candidacy was barred because he is serving a prison sentence for graft. Bolsonaro and Haddad are expected to face off in a run-off vote on 28 October.

Making adept use of WhatsApp and social media, Bolsonaro has built support across Brazil, attacking Lula’s Workers’ party for its involvement in a huge graft scheme and espousing a hardline approach to law and order. His views have resonated with Brazilians angry and fearful over endemic corruption and rising violent crime. Supporters stage drive-by demonstrations, racing through towns across Brazil in convoys of cars and motorbikes, waving flags and blasting horns.

Facebook Twitter Pinterest People gather during a demonstration against Brazil’s presidential candidate Jair Bolsonaro. Photograph: Nacho Doce/Reuters

The divisions Bolsonaro provokes in Brazil were evident in a video of him boarding Saturday’s flight from São Paulo. While some passengers regaled him with chants of “legend”, others yelled “fascist” and “not him”.

Journey to Brazil's heart: across 2,600 miles and seven states, we ask – how will Brazilians vote? Read more

In a television interview broadcast on Friday, Bolsonaro suggested Brazil’s armed forces could intervene if his main rivals, the leftist Workers’ party, “committed a foul” in the election.

“I don’t accept an election that is not me being elected,” Bolsonaro told reporter José Datena, adding that Brazil’s electronic voting system could be defrauded by the Workers’ party, but providing no evidence.

Bolsonaro enjoys widespread support among police and the military. His vice-presidential candidate, Gen Hamilton Mourão, unnerved Brazilians recently when he said in a situation of “anarchy”, a president could declare an “auto-coup”. Both men praise the military dictatorship that ran Brazil from 1964-1985, torturing and executing opponents.

“I lived [during] this phase,” said Maria do Carmo, 84, who was protesting in Rio and saw relatives imprisoned by the military regime. “It was terrible.”

On Sunday, the Folha de S.Paulo newspaper called on both leading candidates to make a commitment to democracy, accusing Bolsonaro of “stimulating paranoias of manipulation” and criticising the Workers’ party for its attacks on the justice system for Lula’s imprisonment it calls politically motivated.