Meanwhile, the cheering crowds that packed downtown Dakar, the Senegalese capital, late Sunday night were celebrating not so much the victory of the winner, Macky Sall, as the upholding of an ideal that appeared threatened by the maneuverings of the incumbent, President Abdoulaye Wade.

“The defeat of Wade,” Le Quotidien, a daily newspaper in Dakar, wrote on its front page Monday, “has transformed itself into a victory for the people, and for Senegalese democracy.”

Over the course of several years, a slow boil of resentment against Mr. Wade built. He was blamed for installing his son in positions of power, with an eye to a possible takeover; for trying to change the constitution to make re-election easier; and for seeking a third term when Senegalese law limits the president to two. What the country achieved over 50 years — a chief executive with some accountability at the ballot box — appeared to be under assault.

In the streets here was a sense of offense. The president was breaking the rules. “We put him in power, and we had hope,” said Lamine Diop, who was waiting to vote in the first round last month. “But he’s tried to force things, and that’s it.”

He added, looking at the long lines of voters, “We’ve never seen this kind of mobilization before.”

Mr. Wade, with his limousines and his grandiose projects, was seen as setting himself above the people who had put him in office. “Abdoulaye Wade was living in an ivory tower,” Le Quotidien wrote on Monday. “He had lost all sense of the reality being lived by his fellow citizens.”

Three times over the last 10 months, the Senegalese pushed back against Mr. Wade.

First, there was a large-scale demonstration in Dakar in June that forced him to retreat on his constitutional changes; next came voting in which he finished with a humiliating 34 percent of the vote, after months of boasting that he would easily win a first-round knockout; and Sunday, he suffered what appeared to be a crushing defeat in the runoff at the hands of Mr. Sall, his former prime minister.

“A victory on the order of a plebiscite,” Mr. Sall said early Monday, savoring its scale.

Senegal, with its long tradition of voting and respect for the rules, was often seen as an exception on the continent.