BAGHDAD — Prime Minister Nuri Kamal al-Maliki’s defiant fight to retain power in Iraq appeared to collapse on Tuesday after his former backers in Iran, the military and his own party all signaled that he could no longer expect their support.

He issued a statement saying that the security forces, which he had deployed around the capital on Monday in what some took to be preparations for a coup, should stay out of politics. And the conversation in Baghdad shifted to how he would leave office and on what terms.

The shift came after Mr. Maliki made several last-ditch efforts to shore up support, only to be confronted late Monday night with delegations of officials, all pleading with him to back down for the good of the country.

The next morning, an important Iraqi Army general in Baghdad reached out to Iraq’s new president, Fuad Masum, and the man he nominated to be the next prime minister, Haider al-Abadi, and delivered the message that the military would not stand by Mr. Maliki, according to a senior Iraqi official.