BAGHDAD (AP) — Nouri al-Maliki, Iraq’s prime minister for the past eight years, relinquished the post to his nominated replacement late Thursday, ending a political deadlock that has plunged the country into uncertainty as it fights a Sunni militant insurgency.

Standing alongside fellow Dawa Party member, Haider-al-Abadi, al-Maliki said he was stepping aside in favor of his “brother,” in order to “facilitate the political process and government formation.”

Al-Maliki said the decision to back al-Abadi reflected his desire to “safeguard the high interests of the country,” adding that he would not be the cause of any bloodshed. “My post is your confidence in me,” he declared in a televised address.

Al-Maliki has been struggling for weeks to stay on for a third four-year term as prime minister amid an attempt by opponents to push him out, accusing him of monopolizing power and pursuing a fiercely pro-Shiite agenda that has alienated the Sunni minority.

The pressure intensified this week when his Shiite political alliance backed al-Abadi to replace him, and President Fouad Massoum nominated al-Abadi to form the next government. Al-Maliki for days has refused to step aside, threatening legal action against the president for what he said was a violation of the constitution.

But in a meeting of his party earlier Thursday, al-Maliki agreed to endorse al-Abadi as the next prime minister, two senior lawmakers from his State of Law parliamentary bloc — Hussein al-Maliki and Khalaf Abdul-Samad — told the Associated Press.

The lawmakers said al-Maliki also agreed to drop a suit before the constitutional court challenging al-Abadi’s nomination.

Al-Maliki had grown increasingly isolated as he was deserted not only by his Shiite allies but also top ally Iran, the United States and the U.N. backed al-Abadi, who has 30-days to put together a Cabinet for parliament’s approval.

The U.N. Security Council urged al-Abadi to work swiftly to form “an inclusive government that represents all segments of the Iraqi population and that contributes to finding a viable and sustainable solution to the country’s current challenges.”

The U.S. and other countries have been pushing for a more representative government that will ease anger among Sunnis, who felt marginalized by al-Maliki’s administration, helping fuel the dramatic sweep by the Islamic State extremist group over much of northern and western Iraq since June.

The extremist Islamic State group’s lightning advance across much of northern and western Iraq has driven hundreds of thousands of people from their homes since June, and last week prompted the U.S. to launch aid operations and airstrikes as the militants threatened religious minorities and the largely autonomous Kurdish region.

The U.N. on Wednesday declared the situation in Iraq a “Level 3 Emergency” — a development that will allow for additional assets to respond to the needs of the displaced, said U.N. special representative Nickolay Mladenov, pointing to the “scale and complexity of the current humanitarian catastrophe.”

The decision came after some 45,000 people, members of the Yazidi religious minority, were able to escape from a remote desert mountaintop where they had been encircled by Islamic State fighters, who view them as apostates and had vowed to kill any who did not convert to Islam.

The U.N. said it would provide increased support to the Yazidis and to 400,000 other Iraqis who have fled since June to the Kurdish province of Dahuk. A total of 1.5 million people have been displaced by the fighting.

The United States has been carrying out airstrikes in recent days against Islamic State fighters, helping fend back their advance on Kurdish regions.

French President Francois Hollande on Thursday confirmed the “imminent delivery of military equipment” to Kurdish forces in a phone call with the new Iraqi president, Fouad Massoum, Hollande’s office said. It did not specify the type or amount of equipment.

The statement said Paris would also provide more humanitarian aid. France has sent dozens of tons of aid in several deliveries this week.

___

Abdul-Zahra reported from Boston. Associated Press writers Vivian Salama, Sinan Salaheddin and Murtada Faraj in Baghdad, Elaine Ganley in Paris, and Robert Burns and Julie Pace in Washington contributed to this report.