Al-Maliki, a Shiite, narrowly held onto a second four-year term despite falling short in national elections last year. His successor will be the first to lead without U.S. military help since the fall of Saddam Hussein after American troops fully withdraw as planned by the end of this year.
The prime minister made no public statements on Saturday, but his decision was broadcast on state TV and confirmed by his media adviser, Ali al-Moussawi.
Al-Moussawi said al-Maliki also wants to change the Iraqi constitution before he leaves office to limit all future prime ministers to two terms.
"Eight years is enough for him, in order to not convert to a dictatorship," al-Moussawi told The Associated Press, as state TV announced al-Maliki's decision. "This is the principle and the concept of democracy."
Saturday's stunning announcement follows al-Maliki's decision a day earlier to return half of his annual salary to the government - a move he said was aimed at narrowing the wide gap between rich and poor Iraqis.
Al-Maliki is not required to publicly report his pay, but he is believed to earn at least $360,000 annually. The U.S. government estimates that as many as 30 percent of Iraqis are unemployed.
The salary cut appeared calculated to insulate al-Maliki from the anti-government unrest spreading across the Middle East, as clerics and protesters warned him not to ignore public bitterness over Iraq's sagging economy and electricity shortages. And his announcement Saturday that he would step down after two terms - a deadline more than three years away - appeared fueled by the same desire to shield Iraq from uprisings like those in Tunisia and Egypt.
Some Iraqis were pleased to see him preparing to give up power.
"He shortened the path for himself and we do not regret that he made this decision," said Akram Saaied, a 52-year-old Baghdad resident who works in the Oil Ministry. "Let him leave as soon as possible because he did nothing for the nation."
The announcement is particularly astonishing in light of his drawn-out fight last year to keep his job after his party fell short of winning the most seats in parliamentary elections last March. Al-Maliki remained prime minister only after pulling enough support from allies in months of closed-door negotiations and promising to share power with a rival Sunni-based political alliance.
Iraqi lawmakers sounded unsurprised at his decision, pointing to Egyptian clamoring for President Hosni Mubarak to step down as a lesson for other Arab leaders not to overreach in power or time in office.
"All politicians across the Arab world who have enough wisdom should take the example and lessons from this matter and not keep their post forever," said Jamal al-Battikh, a Sunni lawmaker and member of the secular Iraqiya alliance that came out narrowly ahead of al-Maliki's party in the national vote.
Hakim al-Zamili, a Shiite lawmaker from the anti-American Sadrist political group, said al-Maliki's decision to leave gives "insurance to the nation that there will be neither control of power nor a dictatorship, and authority will not be willed to a picked successor but through the democratic process."
Al-Maliki, 60, took office as the third prime minister of post-Saddam Iraq in May 2006. Raised in modest surroundings outside the Shiite holy city of Karbala, he was nominated as prime minister with U.S. backing as a compromise candidate who at the time was widely seen as a weak and untested leader.
But al-Maliki quickly assumed strength in Iraq, notably by sending military forces to quell Shiite militias in Baghdad and Basra in campaigns that made an enemy out of anti-American cleric Muqtada al-Sadr. It was al-Sadr, however, who bowed to Iranian urging and threw his support behind al-Maliki to let the prime minister cling onto his job for a second term last year.
During his time in office, al-Maliki amassed power in large part through creating unconstitutional brigades of security forces that answered only to him, leading critics to deride him as another Saddam. Parliament is currently reviewing a recent Supreme Court ruling that folded several government agencies - including the Central Bank, the High Electoral Commission and an anti-corruption office - under his control.
Charles W. Dunne, a former White House and Pentagon adviser, said the move "is a good reflection on Iraqi democracy."
"While Iraq is not in danger of an Egyptian-style upheaval, this does show that al-Maliki is sensitive to the winds of political change," said Dunne, now an Iraq expert at the Middle East Institute in Washington.
In a Jan. 30 interview with state TV, al-Maliki hinted that he would not stay beyond 2014 and said he would push for reforms that would limit the prime minister and president to two terms in office.
"The change is a national demand," he said then.
Kurdish lawmaker Mahmoud Othman said al-Maliki's power may only increase in the three years he has left in office, now that he will no longer be looking over his shoulder at political challengers.
"He will be stronger to do his mission because he does not want to stay for a longer period," Othman said. "Therefore he will have stronger influence on the Cabinet and make them more effective."
Associated Press writer Mazin Yahya contributed to this report.