Jair Bolsonaro’s climb to power has been marked by divisive rhetoric and offensive speech that has thrilled followers and appalled critics in equal measure.

The far-right former army captain’s rise has left some baffled. Mr. Bolsonaro served seven consecutive terms in Congress, with little to show for his time there; very few of his bills were approved.

But many Brazilians, angered by their country’s economic crisis, soaring violence and corruption scandals, interpreted his long list of caustic remarks as blunt but bracingly honest talk from a man willing to say — and do — whatever was necessary to bring about the change they craved.

On Women, Race and Sexual Orientation

Mr. Bolsonaro has described having a female child as a “weakness,” and has said he would not treat or pay women the same as men in the workplace.

“Because women get more labor rights than men, meaning they get maternity leave, the employer prefers to hire men … I would not employ [women equally]. But there are a lot of competent women out there.”

In 2014, he told a fellow lawmaker:

“I would not rape you because you are not worthy of it.”

In 2013, he said that he would “rather have a son who is an addict than a son who is gay,” and that he was “proud to be homophobic.”