The move defuses a political deadlock that has plunged Iraq into uncertainty and opens way for the formation of a new government that could take on a growing insurgency by Sunni militants that has engulfed much of the country.
Al-Maliki made the announcement on national television late Thursday, standing alongside senior members of his Islamic Dawa Party, including rival Haider al-Abadi. He said he was stepping aside in favor of his "brother," in order to "facilitate the political process and government formation."
- ISIS protesters call 'Death to Jews' in The Hague
- New Jersey man removes Islamic group-linked flag
- Iraq: ISIS executed at least 500 Yazidis
The premier-designate al-Abadi, a veteran Shiite lawmaker, now faces the immense challenge of trying to unite Iraqi politicians. The country's major political factions deeply distrust each other and the army seems unable to regain territory in the north and west taken by militants from the Islamic State group.
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 UN 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 the Islamic State extremists who have captured large swaths of Iraqi territory.
Al-Maliki said his decision reflected a desire to "safeguard the high interests of the country," adding that he would not be the cause of any bloodshed.
His refusal to give up the post after eight years in power had provoked a political crisis that escalated this week in Baghdad. 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 threatened 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, two senior lawmakers from his State of Law parliamentary bloc - Hussein al-Maliki and Khalaf Abdul-Samad - told The Associated Press. The two said al-Maliki also agreed to drop a suit before the constitutional court challenging al-Abadi's nomination.
The White House commended al-Maliki's move 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.
US Secretary of State John Kerry said the move "sets the stage for a historic and peaceful transition of power in Iraq."
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 UN backed al-Abadi, who has 30 days to put together a Cabinet for parliament's approval.
The UN 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 is to blame for much of Iraq's troubles. "The years he ruled were the worst in Iraq's history and he bears that responsibility," Hussein said.
The US 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, which helped fuel the dramatic sweep by the Islamic State extremist group.
The militants' lightning advance across much of northern and western Iraq since June has driven hundreds of thousands of people from their homes, and last week prompted the US to launch aid operations and airstrikes as the militants threatened religious minorities and the largely autonomous Kurdish region.
The UN on Wednesday declared the situation in Iraq a "Level 3 Emergency" - a decision that 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 UN 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.
The European Union's foreign ministers will hold an emergency meeting Friday on Iraq to coordinate their stance on military support for the Kurds and on providing humanitarian assistance for those fleeing the fighting.