BAGHDAD — When Iraq's anti-government protests began last year, it was supporters of renowned Shiite Muslim cleric ­Moqtada al-Sadr who added heft.

They came in the thousands, manning front lines during clashes with riot police and providing security for the demonstrators as they settled in for the long haul.

Now, it might be Sadr who extinguishes their fight.

A flurry of statements from the cleric in recent months has fractured the movement, prompting accusations of betrayal. He has pulled his supporters away from protest camps and then sent them back to battle those who remained.

Threats made by his militiamen have sent political activists into hiding. Sadr’s followers have attacked his critics with knives.

“They’re insulting Sadr, and we can’t allow it,” cried one of his supporters, Saeed Alaa al-Yassiri, on a recent day in Baghdad’s central Tahrir Square as his group pushed demonstrators back with sticks and knives. “They’re serving American agendas now. This square needs to be cleaned.”

Sadr is a storied figure in Iraq, with a history of agitation against U.S. troops and fierce loyalty from tens of thousands of pious and working-class acolytes.

But he is also something of a shape-shifter; in the years since the 2003 U.S.-led invasion, the cleric has positioned himself variously as a sectarian militia leader, a revolutionary figure and a nationalist who can unify the country. His reliance on Iranian support has also waxed and waned, depending at times, it has seemed, on the optics for his political base.

Since October, Iraq’s protesters have been calling for an end to government corruption and politics shaped by the aftermath of the 2003 U.S.-led invasion. (Mustafa Salim, Ali Dabdab/The Washington Post)

But Iraq’s youth movement has emerged as a challenge to his long-standing image as a man who can command the country’s streets. As the largest spontaneous uprising in the country’s history, the protest movement has already felled one government and rejected a prime ­minister-designate that Sadr had backed. The candidate, Mohammed Tawfiq Allawi, stepped aside Sunday.

More than 500 demonstrators have been killed by Iraq’s security forces and Iran-backed militias since October, human rights and security officials say. The violence has turned what started as anti-corruption protests into a revolt against the entire political system, with growing anger and mockery directed at Iran’s leading role — and now at the cleric himself.

“In this sense, it is the nature of Iraq’s protest politics that has changed, not Sadr himself,” said Ben Robin-D’Cruz, a researcher on Iraqi politics at the University of Edinburgh.

Sadr’s followers joined the protests on day one. Young men from Sadr City — a poor and sprawling district of Baghdad named for his father, a slain ayatollah, where he has long enjoyed popular support — turned up spontaneously and repeatedly clashed with Iraq’s riot police.

The protesters say they are fed up with the endemic corruption and lack of political freedoms that grew out of a political system forged in the wake of the U.S.-led invasion. Despite initial support for their demands, Sadr called for a separate march with the support of Iran-backed militias in late January and then tweeted — apparently from Iran — that he would “try not to interfere in the [protests], either negatively or positively.”

He ordered his supporters to leave Iraq’s protest camps days later, and then he sent them marching back, this time in opposition to the young crowds they once camped alongside.

“It’s not the riot police attacking us anymore, it’s them,” said Walid Fadhil, 27, watching warily on a recent day as the violence unfolded.

Dozens of people have been killed or wounded in the latest clashes.

“It’s changed everything,” said Reem, a 28-year-old protester in Baghdad’s Tahrir Square, waving her hand toward the tents that have emptied out in recent weeks.

On her cellphone was an image, apparently showing an ominous, online chat between a member of Sadr’s militia and another person she knew. The chat included photographs of mostly women protesters, among them Reem. “We have information about 40 people from the protests,” the message read below it. “We should take care of them.”

Political experts say Sadr has long sought to balance the needs of Iraq’s streets and the Iran-backed militia structure of which he is a part. But as tensions escalate between Iran and the United States, especially in the wake of President Trump’s decision to kill Iranian military commander Qasem Soleimani and Iraq’s most influential militia leader, Abu Mahdi al-Muhandis, Sadr’s room for maneuver has diminished.

Sadr decided it was time to trade in his backing for the protest movement for a central role in the coalition of Iranian-backed militias, Robin-D’Cruz said.

“For Sadr, reform means a gradual movement towards putting the country on track rather than the radical reform that the protesters are taking about, which is basically the fall of the entire political class and system,” said Abbas Kadhim, director of the Atlantic Council’s Iraq Initiative.

Many of Sadr’s supporters have followed his instructions, withdrawing from the protests. But others have questioned him, in some cases for their first time. “It was hard to understand why he would do this to us,” said a young man in Tahrir Square, speaking on the condition of anonymity because of the sensitivity of his situation. “He gave the order to leave, but some of us will stay. This is a fight for Iraq, not for politicians.”

Some protesters say they have received threats, urging them to depart, and some have acquiesced. Others have dismantled tents they had lived in for months and then melted into the crowds.

Sajad Jiyad, director of the Baghdad-based Bayan Center research organization, said Sadr’s shifting position will make it harder for him to claim he’s above Iraq’s political cut and thrust. “It’s now apparent to everybody that he is part of the same political elite,” Jiyad said. “It reinforces the idea of this being the political elite on the one side, the average protester on the other.”

In Tahrir Square last week, Reem described the cleric’s reversal as the start of a “major change.” Many protesters had departed, worried about escalating violence and heightened factionalism.

Her tent had once been a hub for some of the city’s most well-known activists. But most had left for Turkey, following threats from Iran-backed militias and individuals associated with Sadr.

“They could deal with threats to themselves, but not to their families,” Reem said. “This was about kidnapping, killing.” But she would be staying, she insisted.

“I leave here in victory or a coffin. No other way,” she said.