But in a measure of just how complex Iraq has become, it is impossible to tell where loyalties to Mr. Sadr end and criminal activity begins. Rogue groups of his former followers now run underground fiefdoms of sectarian killing and kidnapping — and even a special market for victims’ cars. One of his senior aides was arrested by the American military earlier this week on suspicion of having directed the killing and torture of Sunnis. The Americans later reluctantly released him at the request of the Iraqi government.

The changes in the Mahdi Army are so profound — the American military estimates that as much as a third of it has fallen away — that it is becoming a generic term for Shiite militia. A senior American military official estimated there were 23 militias operating in Baghdad alone.

“It’s hard to understand the amount of groups who are moving around and where they are getting their funding,” said Col. Thomas Vail, the American commander in charge of eastern Baghdad. “It’s very complex right now, more than when we first came.”

The mechanisms for killing have become more sophisticated. A senior coalition intelligence official at a briefing last month detailed an example of a Mahdi Army death squad. Group leaders are issued instructions on order forms listing a target person and an address, the official said. A group can consist of special forces, intelligence units and punishment committees, complete with clerics who impose sentences. Some of the leaders may be inside the Interior Ministry, the official said. Others may work with their contacts within the ministry to obtain equipment such as cars.

The American military’s task has been vastly complicated by the sheer relentlessness of the violence. Ever larger portions of the Iraqi population have been radicalized in three years of war, chopping ground out from under the moderates. Now, even those whose job requires them to take a position against militias reluctantly back them.

“Right now I support the presence of the Mahdi Army,” said a senior judge on Iraq’s criminal court, who declined to be named out of concern for his safety. “I know this is unacceptable in law, in politics, in society, but in this unusual time we are living in, this is the reality.”

It is a broadly held view among Shiites that the American military has unfairly focused on Shiite militias and has largely forgotten the Sunni militias that they say launched the sectarian war. Groups like the Omar Brigade, formed to kill Shiites and carry out lethal suicide bombings, went unchecked, prompting a Shiite response, they say.