Standing alongside senior members of his party, including rival 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 had 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 United States, the U.N. and a broad array of political factions in Iraq had backed al-Abadi, saying only a new leader could unify a country under siege from Sunni extremists of the Islamic State group that have captured large swathes of Iraqi territory.
Al-Maliki said his decision to throw his support behind al-Abadi reflected a desire to "safeguard the high interests of the country," adding that he would not be the cause of any bloodshed. "My position is your trust in me, and no position is higher than your trust," he declared in a televised address.
Al-Maliki's refusal to give up his position after eight years in power had provoked a political crisis that escalated this week in Baghdad, where armed guards patrolled most major bridges, intersections and roadways.
The pressure intensified when his Shiite political alliance backed al-Abadi to replace him, and President Fouad Massoum nominated al-Abadi on Monday to form the next government. Al-Maliki 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.
The White House commended al-Maliki for backing al-Abadi and expressed hope that the power shift "can set Iraq on a new path and unite its people" against the threat from Islamic militants, national security adviser Susan Rice said in a statement.
U.S. Secretary of State John Kerry said the move "sets the stage for a historic and peaceful transition of power in Iraq. We urge Mr. Abadi and all Iraqi leaders to move expeditiously to complete this process, which is essential to pulling the country together and consolidating the efforts of Iraq's many diverse communities against the common threat posed by the Islamic State."
The United Nations special representative for Iraq, Nickolay Mladenov, also welcomed the move, saying it "demonstrates statesmanship and a commitment to the democratic process and the constitution."
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."
Iraqis of all sects welcomed Thursday's announcement.
"Now, all we want is a government that respects the people and does not discriminate against them," said Youssef Ibrahim, 40, a Sunni government employee in Baghdad.
Adnan Hussein, 45, a Shiite in Sadr City, said he believes al-Maliki stepped down "because he came under enormous pressure and threat from inside and outside Iraq... The years he ruled were the worst in Iraq's history and he bears that responsibility."
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 that has seized large swathes of territory of northern and western Iraq since June.
Widespread discontent with al-Maliki's rule has reached the point where both Saudi Arabia and Iran - regional rivals often bitterly divided over Iraq - have expressed support for al-Abadi. The United States, the European Union and the United Nations have also offered support for new leadership.
Al-Maliki "defamed his image by threatening to use force or to complain to the federal court," said Aziz Jaber, a professor of political science at Baghdad's Mustansiriyah University. "The main reason al-Maliki was forced to accept this new reality is the stance of the Marjayah (Iraq's elite Shiite clerics) and the rare agreement of Iran and Saudi Arabia that he should leave."
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 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.