“Let us not lose spirit,” said Barbara Nowacka, head of the Left Alliance. “Although society tell us, ‘No, we want the right,’ we do know that the time for the left will come and then we will be waiting, strong and determined, with our heads high.”

With 38 million residents, Poland is both the largest and the most economically vibrant nation in Eastern Europe and has emerged in recent years as a regional leader. Still, disenchanted voters have proved increasingly tired of hearing about a thriving economy that they feel has left too many behind and that still lags far behind those of more prosperous, Western European nations.

Under Poland’s complex voting rules, a party can take control of the government without the need for a coalition partner even if it draws less than 40 percent of the vote, depending on how many of the smaller parties cross the 5 percent threshold required to earn seats in the new Parliament.

Although the exit polls seemed to suggest that Law and Justice might end up with a majority in Parliament while three smaller parties drew enough votes to get in, as well, the official roster of those that were able to cross the threshold will not be released until Monday. Only then will it become clear whether Law and Justice can form a government on its own, or will need to seek a coalition partner.

Civic Platform has been under a cloud since last summer, when several government officials were caught making profane and impolitic comments on illegal wiretaps. It suffered a further blow when its leader, Donald Tusk, resigned as prime minister last year to become president of the European Council in Brussels.

“The carnival that is the election is over,” Mr. Kaczynski told Law and Justice supporters on Sunday. “Now it is time for real work. We must remember about modesty, which binds us.”