Over the past two years, while many of Brazil’s traditional political parties and powerful kingmakers were busy defending themselves against corruption allegations stemming from the investigation known as Lava Jato, Mr. Bolsonaro flew around the country, drumming up support, particularly among young men, and in comparatively wealthier and whiter areas.
While rivals spent small fortunes on marketing firms, video editors and consultants, Mr. Bolsonaro relied primarily on Facebook, Twitter, YouTube and the instant messaging service WhatsApp to communicate with voters and expand his base.
Opponents enjoyed far more advertising time on television and radio — which is allotted by party size — and rolled out slickly edited campaign materials. But Mr. Bolsonaro’s campaign drowned them out with a bare-bones, scrappy communications strategy. He and his sons broadcast shaky, poorly lit videos on Facebook and Instagram in which Mr. Bolsonaro cracked jokes, took aim at adversaries and bemoaned the state of Brazil.
On WhatsApp, supporters created hundreds of groups to share memes, videos and messages that often contained falsehoods and misleading content that cast Mr. Bolsonaro in a positive light and disparaged his rivals.
One dominant message, spread widely via WhatsApp, asserted with no evidence that Mr. Bolsonaro’s opponents encouraged schoolchildren to become gay or reconsider their gender identity by employing sex education materials referred to as “gay kits.”
“I like what Bolsonaro stands for,” said Cintia Puerta, 55, an architect in São Paulo, said Sunday after voting. “My sister works in a school so I know they are teaching ‘gay kits’ to children, teaching them about sexuality at age 5 and 6. They’re indoctrinating children in the school.”
Mr. Bolsonaro’s presidential ambition nearly ended on Sept. 6 when a man sliced a knife into his stomach during a campaign rally, slashing his intestines and several other organs.