“Maliki knows if he steps down, virtually he is a dead man,” said Ali Khedery, a former American official in Iraq, who over the years has advised five American ambassadors and several American generals and was once close to Mr. Maliki himself.

Adding to the sense that the country was rapidly coming apart, suicide attackers struck twice in Kadhimiya, a Shiite district in Baghdad that is home to an important shrine, killing nearly three dozen people. And in Kirkuk, a northern city long divided between Arabs and Kurds that is now under Kurdish control, two explosions struck near a Shiite mosque, killing 11 people and wounding more than 50 others.

After ISIS captured Mosul, Iraq’s second-largest city, on June 10, the militant group vowed to march on Baghdad. But its rapid advance south toward the capital stalled in the face of newly mobilized Shiite militias, and volunteer Shiite fighters determined to protect Iraq’s capital and the holy Shiite cities of Najaf and Karbala.

The Kurds had tried to seize on the chaos. protect their borders and consolidate their autonomy, while staying out of Iraq’s broader civil war. The pesh merga were considered well armed and well motivated, determined to protect their Kurdish enclave in the north.

But the latest fighting has shown that even the pesh merga are not up to the fight with ISIS. Kurdish officials have complained of a lack of ammunition and begged American diplomats for more weapons. But the United States, so far, has held off on significant arms shipments to the Kurds, fearing that it could undermine the central government in Baghdad.