SÃO PAULO, Brazil — Just hours after Jair Bolsonaro won Brazil’s presidential election in a landslide victory for conservatives, Carolina Zannata and her girlfriend called the closest public notary and set a date for their wedding.

Gay marriage has been legal in Brazil since 2013, and Ms. Zannata said she and Aline Foguel had not been in a hurry to wed. But the triumph of Mr. Bolsonaro — a far-right politician who once declared “I’m homophobic, with pride” — changed their calculations.

“We got scared,” said Ms. Zannata. “We need to take advantage of our hard-won rights because we might not have them afterward.”