BRASÍLIA — By eight o’clock Sunday evening, Brazil’s Superior Electoral Court had a number, and by nine the number had a verdict: President Luiz Inácio Lula da Silva, who turns 81 next month, had won a fourth term, 51.79 percent to 48.21 percent over Senator Flávio Bolsonaro, a margin of roughly 4.4 million votes in a country of 150 million voters. By ten, world leaders were congratulating. By Monday breakfast, the loser had not conceded anything to anyone, least of all the clock.

Flávio Bolsonaro declined to accept the result, a sentence now so familiar it hardly needs a country. His father, former president Jair Bolsonaro, sits in prison serving a sentence imposed by his country’s supreme court, was barred from running again, and had endorsed his son from his cell with the calm of a man submitting a claim. The son ran the campaign his father could not, lost it by 3.6 points, and is, by all reports, not finished.

What makes the night remarkable, for the careful observer, is how confidently Brazilian voters pointed at the mirror and declared it Uruguay.

Brazil did, in fact, reelect an octogenarian for a fourth helping of the same thing — a feat the oldest sitting president in the country’s history accomplished with his usual stamina, having previously already been imprisoned for it in an earlier round of Brazilian history and then winning anyway, which political scientists describe as the strongest possible endorsement. Brazil watched the same spectacle its northern neighbors keep swearing only happens to them — the near tie, the dynastic vendetta, the loser who is not done — and drew the only conclusion available to a nation of 215 million people: that this time it was different.

"'The Brazilian voter is not confused about democracy. He is so confident in democracy that he returned the man who was once in prison for it, the son of the man who is in prison for it, in one lifetime, and then went to the beach,'" said Dra. Camila Prado, a political scientist at the University of Campinas, who described the runoff as 'a loyalty test with a ballot box, administered twice.'"

The mechanics were, by any standard, honest. Voting in Brazil is compulsory, which means every citizen was drafted into the electorate whether or not he had opinions, and the electronic ballots have run since 1996 without the kind of controversy that requires an act of Congress to explain. The electoral court’s count was accepted by the army, the churches, and the markets within hours. The one institution that withheld judgment was the Bolsonaro household itself, which released a statement Sunday noting that it “respects the process” while disputing its outcome, a combination Brazilians describe with a patient word that translates roughly as “for now.”

Lula, asked late Sunday what he intended to do with a fourth term, gave the answer of a man who has done this four times: he thanked the voters, said he would govern for those who did not vote for him, and then asked the crowd to sing. The crowd sang. A man holding a banner the size of a sail screamed until he cried. In Brasília, the government buildings that the architect Oscar Niemeyer designed to look like the future stood lit against the dark while the future, for the fourth time, confirmed its incumbent.

The transition will proceed on schedule. The inauguration is set for January 1. Flávio Bolsonaro’s office did not respond to a request for comment.