BAGHDAD — The resignation of embattled Iraqi Prime Minister Adel Abdul Mahdi amid sustained protests for sweeping reform has set the stage for a new political crisis as the ruling class scrambles to address demonstrators’ grievances.

The looming showdown in parliament over who will lead this country next comes as protesters clash with security forces in Baghdad and other cities in an effort to topple a system that they say ­favors an ossified elite. The demonstrators, thousands of whom are camped out in Baghdad’s Tahrir Square, have called for a new election law and an end to the power-sharing arrangement that divides government spoils among Iraq’s political heavyweights.

The grass-roots movement, which is two months old, is posing the most serious challenge to Iraq’s political order since the U.S.-led invasion in 2003. More than 430 demonstrators have been killed in the unrest, a human rights official said Sunday. He spoke on the condition of anonymity because he was not authorized to release casualty figures to the media.

Officials here are also grappling with the political preferences of outside powers such as the United States, which was heavily involved in the backroom political deals ahead of Abdul Mahdi’s appointment last year, and Iran.

Abdul Mahdi was appointed after months of political wrangling in parliament. His departure, approved by lawmakers on Sunday, offers authorities a chance to begin enacting real change, lawmakers and analysts said. Iraqis are fed up with high unemployment rates, widespread graft and a lack of government services. They point to Iraq’s vast oil reserves as evidence that the country’s wealth is being squandered.

“Iraq has a historic chance to form a strong government, a government free from outside interference,” said Ahmed al-Mayali, an Iraqi political analyst.

Abdul Mahdi announced his plans to resign Friday after violence erupted overnight across several cities and security forces killed at least 45 demonstrators over a 24-hour period. The country’s top Shiite cleric, Grand Ayatollah Ali Sistani, suggested that lawmakers reconsider their support for Abdul Mahdi’s government.

But parliament — which is made up of rival political blocs, none of which hold a commanding majority — is unlikely to agree on a replacement, some lawmakers said. Parliament has just 15 days to choose a prime minister, who will then be granted 30 days to form a government.

The leaders of the two largest coalitions — Moqtada al-Sadr, a firebrand Shiite cleric, and Hadi al-Amiri, who is backed by Iran — have publicly split over the prime minister’s resignation. In a statement last month, Sadr vowed never to work toward a political consensus with Amiri again after the latter apparently backtracked on an agreement to subject Abdul Mahdi to a no-confidence vote in parliament.

Amiri was a key leader of the paramilitary Popular Mobilization Forces, an umbrella group of Shiite militias that was formed to battle Islamic State militants and that has enjoyed considerable support from Iran.

Iran has played a significant role in Iraqi politics since Tehran threw its weight behind the militias. But that support might have backfired. Demonstrators in majority-Shiite cities such as Najaf and Karbala have stormed or burned Iranian consulates and defaced posters of Iran’s supreme leader, Ayatollah Ali Khamenei.

Iran, which is governed by a Shiite theocracy, has used military and financial largesse to help shape Iraq’s political landscape.

“We really hope that Iran this time will leave the Iraqi people to choose their own fate,” said Naji al-Saadi, a member of the pro-Sadr Sairoon bloc.

Mayali said that “Iranian leverage is not on the level it was before the protests.” Iranian officials, he said, “are no longer free to form a government that is close to Iran.”

Even as lawmakers paid lip service to the need for change, they conceded that a new leader would inherit a restive and fractured nation reeling from a security crackdown that appears to have only hardened protesters’ resolve.

On Sunday, a demonstrator was killed by security forces in Baghdad as the sides clashed on Rasheed Street, officials said.

Demonstrators have sought to protect the vast protest site they have set up in Tahrir Square and surrounding streets, which they have transformed into a mini-
republic with art installations, medical facilities, restaurants and free libraries. Police have tried to prevent demonstrators from crossing bridges that lead to government buildings and embassies in the heavily secured Green Zone.

In Najaf, home to the shrine of Imam Ali, a revered figure in Shiite Islam, a court announced Sunday that it was seeking arrest warrants for “those responsible for the deaths of protesters.” It did not elaborate.

At least a dozen were killed last week as they faced off against security forces. The governor of Najaf said he would appear before judicial authorities to testify about the unrest.

“The best solution right now is to have all the factions [in parliament] agree on someone who also has the approval of the protesters,” said Hussein al-Iqabi, a member of parliament’s legal committee.

The new prime minister “will have to put the interests of the people first, put this revolution first, and fight corruption,” he said. “Otherwise, it will be political suicide for the entire political elite.”