BAGHDAD, Iraq, Feb. 15 Late Saturday night, on the eve of a crucial vote to choose Iraq's next prime minister, a senior Iraqi politician's cellphone rang. A supporter of the Shiite cleric Moktada al-Sadr was on the line with a threat.
"He said that there's going to be a civil war among the Shia" if Mr. Sadr's preferred candidate was not confirmed, the politician said.
Less than 12 hours later, and after many similar calls to top Shiite leaders, Mr. Sadr got his wish. The widely favored candidate lost by one vote, and Ibrahim al-Jaafari, the interim prime minister, was anointed as Iraq's next leader.
"Everyone was stunned; it was a coup d'ιtat," said the politician, a senior member of the main Shiite political coalition, the United Iraqi Alliance.
It was a crowning moment for Mr. Sadr, whose sudden rise to political power poses a stark new set of challenges for Iraq's fledgling democracy. The man who led the Mahdi Army militia's two deadly uprisings against American troops in 2004 now controls 32 seats in Iraq's Parliament, enough to be a kingmaker. He has an Islamist vision of Iraq's future, and is implacably hostile to the Iraqis closest to the United States the mostly secular Kurds, and Ayad Allawi, the former prime minister.
Mr. Sadr's militia fighters have been quieter since the uprisings, but they are suspected in a range of continuing assassinations and other abuses that American officials have pledged to stop. Mr. Sadr himself was accused by the American of arranging a killing in 2004, though the arrest warrant was quietly dropped.
"It will be harder to take on the Mahdi Army with Jaafari as prime minister," said a Western official in Baghdad who spoke on condition of anonymity because he did not want to be seen as interfering in Iraqi politics. "Jaafari could not have been elected without Sadr's support."
In one sense, his participation represents the realization of a central American goal: to bring populist, violent figures whether Sunni or Shiite off the battlefield and into democratic politics.
Mr. Sadr's new influence and his populist roots may even help achieve the American goal of a broad-based government that includes all of Iraq's sects and ethnic groups.
American officials have worked especially hard to include the Sunni Arabs, who dominate the insurgency, in the government. And the Sunnis are much closer to Mr. Sadr on some key matters of policy than they are to his Shiite rivals.
Like the Sunnis, Mr. Sadr has said he opposes the creation of semiautonomous regions in Iraq, at least for the moment. He shares the Sunnis' hostility to the American presence, and even sent some of his followers to fight alongside Sunni Arab insurgents in Falluja in 2004.
"We have good relations with Sadr," said Alaa Makki, a leader of the Iraqi Accordance Front, the Sunni group with 44 seats in Parliament. "We are close to him on some points."
That sense of shared purpose may be more important than the hatred many Sunni leaders may feel toward Mr. Jaafari, whose government is widely accused of running death squads in Sunni areas.
It is true that some Sunni Arab leaders favored Mr. Jaafari's rival, Adel Abdul Mahdi, a more secular and pragmatist figure, for prime minister. But others said Mr. Jaafari was no worse than Mr. Mahdi, whose party, the Supreme Council for the Islamic Revolution in Iraq, or Sciri, has strong backing in Iran and is also suspected of killing Sunnis.
Even on the issue of Iranian influence, Mr. Sadr's position is no worse from an American point of view and may even be better than that of his Shiite rivals who have been running the government for the last year. Although Mr. Sadr recently traveled to Tehran and cast himself as a defender of Iran, part of his popular appeal comes from his stance as a homegrown nationalist.
"Sadrists often define themselves as anti-Iranian and accuse Sciri of being Iranian stooges," said Rory Stewart, a former Coalition Provisional Authority official in Amara, a poor southern city where the Mahdi Army holds immense sway. "It's the main reason why people like them."
Mr. Sadr's new political power burst into view last weekend, as the United Iraqi Alliance coalition, which won the largest share of votes in the December election, was trying to decide whom it would name as the next prime minister. In the past, the coalition has mostly worked in a top-down fashion, and this time most party leaders agreed that Mr. Mahdi, who was not tarnished by the mistakes of Mr. Jaafari's government, would be the winner.
But Mr. Sadr made clear to his 32 followers in Parliament that he favored Mr. Jaafari. He told them to put out the word that they would pull out of the alliance, throwing Iraqi politics into chaos, if they did not get what they wanted. The tactic worked, pushing some independent Shiites to vote for Mr. Jaafari out of fear that the alternative would be chaos.
Mr. Sadr had decided to back Mr. Jaafari after his followers met with the prime minister and presented him with a 14-point political program, said Bahaa al-Aaraji, a member of Parliament and spokesman for Mr. Sadr's movement.
"We saw that Jaafari was closer to implementing this program," Mr. Aaraji said, than Mr. Mahdi was.
The 14 demands, he said, include a timetable for the withdrawal of American troops from Iraq; a postponement of any decision about creating autonomous federal regions; more action on releasing innocent detainees from Iraqi and American prisons; and a tough stand against Kurdish demands to repatriate Kurds to Kirkuk, an oil-producing city in the north.
Some of those demands have broad support among Iraqi leaders. But the Sadrists' hostility to Kurdish claims in Kirkuk could lead to a damaging political showdown.
Gaining control of Kirkuk is for a primary goal for the Kurds, and last year they repeatedly accused Mr. Jaafari of stonewalling on the issue. With Mr. Sadr's followers urging him to resist Kurdish pressure, Mr. Jaafari could face a Kurdish rebellion.
There have already been signs of tension with the Kurds and with Mr. Allawi's secular coalition. On Sunday, Iraq's president, Jalal Talabani, a Kurd, warned that the Kurdish alliance, with 53 seats, would not bow to demands that Mr. Allawi's group be barred from the new government. Mr. Talabani did not say it, but he was referring to demands made by Mr. Sadr, who has never forgotten Mr. Allawi's role in putting down the Mahdi Army rebellions in 2004.
"There is not enough room in Iraq for Sadrists and Allawi," Mr. Aaraji said. "He killed many Sadr followers and has a personal position against Moktada. We cannot sit with him."
By far the most troubling aspect of Mr. Sadr's political power is the persistence of his militia. It is difficult to know how much control Mr. Sadr has over the Mahdi Army. Membership is loose and informal, and there appear to be rogue elements working outside of anyone's control; street criminals sometimes operate under a Mahdi Army disguise.
But there is no doubt that the Mahdi Army carries out widespread abuses, including killings. They rigidly apply Islamic rules in areas they control, including Sadr City, the Shiite slum in northeastern Baghdad. They have hunted down and killed hundreds of Iraqis with ties to Saddam Hussein's Baath Party.
"They operate Shariah courts in Sadr City," the Western official said. "It's almost a state within a state, and it's a serious problem."
The Mahdi Army has also worked clandestinely with police commandos in Iraq's Interior Ministry, supplying them with names of people they want arrested or even executed, said an Interior Ministry official who spoke on condition of anonymity out of concern for his safety.
The Mahdi Army, together with Sciri's militia, also control much of southern Iraq, picking fights with the British Army over arrests of their members and even merging with the official police.
"No one can challenge them," said Abd Kareem al-Muhamadawi, a tribal sheik from Amara. "They can do anything, and no one asks why."
Secular Iraqis express alarm at their growing power. At the Baab al Muatham campus of Baghdad University, groups of men patrol common areas and ask to see identification when they spot behavior they deem improper, like couples' sitting alone, said Anmar Khalaf, a student. In one incident, Sadr supporters beat up a professor of the media department for his ties to the Baath Party, students said.
"When they see a boy sitting with a girl, they feel something inside of themselves," Mr. Khalaf said last month, after guards warned him against speaking with a foreign reporter. "The university is unbearable because of them."