After years of defeats, fragmentation and doubt even by its own clerics about its prospects in this election, the movement has embraced the political process, while remaining steadfast in opposition to any ties with the United States. It was never going to be easy to form a new postelection government — and the Sadrists’ unpredictability, along with a new confidence, may now make it that much harder.

“As our representation in Parliament increases, so will our power,” said Asma al-Musawi, a Sadrist lawmaker. “We will soon play the role that we have been given.”

A worshiper at a Friday Prayer service put it more bluntly.

“Today is our day!” he shouted to hundreds of supporters gathered outside the movement’s office in a ramshackle neighborhood that bears its name, Sadr City, where electric wires are tangled like cobwebs and discontent surges forth from a furnace of poverty, anger and frustration.

The results of the election are not yet conclusive, and under a complicated formula to allot seats, the percentage of the vote will not necessarily reflect actual numbers in the 325-member Parliament.

Image Iraqis joined in prayer on Friday in the Sadr City neighborhood of Baghdad. The area is a stronghold of the movement led by Moktada al-Sadr, a Shiite cleric. Credit... Joao Silva for The New York Times

But opponents and allies alike believe the Sadrists may win more than 40 seats. In all likelihood, that would make them the clear majority in the Iraqi National Alliance, a predominantly Shiite coalition and the leading rival of Mr. Maliki. If the numbers are borne out, the Sadrists could wield a bloc roughly the same size as the Kurds, who have served as kingmakers in governing coalitions since 2005.