SAO PAULO/RIO DE JANEIRO (Reuters) - Tens of thousands of people took to the streets of Brazil’s major cities on Saturday in women-led protests against far-right presidential front-runner Jair Bolsonaro, who flew home after weeks in hospital recovering from a near-fatal stab wound.

Angered by Bolsonaro’s history of making offensive comments, which includes belittling rape and calling the gender pay gap justified, female protesters used the hash tag #EleNao, or #NotHim, to drum up support for a series of international protests against the former army captain.

Flag-waving protesters flocked to downtown Rio de Janeiro and Sao Paulo on Saturday afternoon, pouring out of subway trains and into the streets while chanting in unison against a divisive candidate who has led polls for months ahead of the Oct. 7 election, the most polarizing in a generation.

Later, as night fell, television images showed protesters starting small fires and banging drums in the center of Rio.

“I could never be friends with someone who supports a person (like Bolsonaro), who is racist, homophobic and a misogynist,” said Tassia Casseli, who was at the Sao Paulo march.

Bolsonaro nearly died from a stab wound earlier this month and has been confined to Sao Paulo’s Albert Einstein hospital ever since. He was discharged on Saturday morning, and flew to Rio, where he has served as a federal congressman for nearly three decades, in the afternoon.

In a telling sign of the divisive nature of the election, videos uploaded to social media from Bolsonaro’s commercial flight back to Rio showed some of his fellow passengers clapping and chanting “Legend” when he boarded, while others booed.

Slideshow ( 11 images )

“Finally back home, with my family in the warmth of our home. There is no better feeling! Thank you for all the expressions of affection that I saw on the way back and all over Brazil,” Bolsonaro wrote on Twitter. “A big hug to everyone!”

A former army officer who has voiced admiration for Brazil’s 1964-1985 military dictatorship, Bolsonaro has won over many with his hard-line stance on crime, unvarnished rhetoric, and a career that has been largely free of corruption accusations.

Yet he has also repelled many others with comments widely considered sexist, misogynist, and homophobic.

Saturday also saw rival rallies in support of the right-winger across the country.

“I never heard him say anything wrong about women,” said Alessandra Sampaio, 39, at a pro-Bolsonaro rally in Rio. “He’s against rape, drugs and in favor of the family. I have two daughters and want the best for them.”

Bolsonaro stirred fresh controversy on Friday night, when he said that he would not accept the result of next month’s election if he loses, adding that he could not “speak for the armed forces commanders.”

Slideshow ( 11 images )

Bolsonaro’s relative lack of support among women could spell trouble for a candidate who has become investors’ favorite after embracing free-market policies on the campaign trail.

His biggest rival and likely opponent in an expected Oct. 28 runoff is leftist candidate and former Sao Paulo Mayor Fernando Haddad.

Haddad is running for the Workers Party, whose jailed founder, former President Luiz Inacio Lula da Silva, was barred by a corruption conviction. Haddad has surged in recent polls with support from the working class and voters who cannot stomach Bolsonaro.

According to a recent survey by pollster Ibope, 18 percent of women plan to vote for Bolsonaro in the Oct. 7 first round, versus 36 percent of men. In an Oct. 28 second round scenario, among those who expressed a preference, women favored Haddad over Bolsonaro by 47 to 30 percent. Among men 47 percent favored Bolsonaro versus 37 percent for Haddad.