When a rocket struck in Baghdad's Green Zone in 2007 during a news conference by Prime Minister Nouri al-Maliki and UN Secretary-General Ban Ki-moon, the world's top diplomat ducked and looked unsettled. Al-Maliki, however, never flinched, and dismissed the attack as "nothing".
A year later, al-Maliki again stayed calm when an Iraqi journalist angrily threw his shoes at President George W Bush at another news conference. As Bush deftly ducked out of the way, al-Maliki stood by his guest and even raised a hand to try to block one of the shoes.
As he leaves office, al-Maliki will be remembered for dominating Iraqi politics with a steely demeanour for much of the tumultuous decade that followed the 2003 ouster of Saddam Hussein.
The 64-year-old al-Maliki led the country through the height of Shiite-Sunni bloodshed. But his heavy-handed rule also helped plunge it back into chaos.
He was unafraid to move against perceived foes - whether they were militants or political rivals - and he projected an image of unflinching determination as the most influential prime minister since the US invasion.
The stern-faced Shiite with a master's degree in Arabic literature was in many ways an unlikely choice to lead Iraq.
He became prime minister in 2006 only after emerging as a compromise candidate atop a shaky coalition. He finally decided on Thursday (yesterday, NZT) to step aside in favour of Haider al-Abadi after struggling for weeks to stay in power following an election in April.
The grandson of a renowned poet who played a role in the 1920 revolt against the British, al-Maliki fled Saddam's regime in 1979 and was sentenced to death in absentia the next year for his membership in the Dawa Party, Iraq's oldest Shiite political party. He would spend more than two decades in exile in neighbouring Syria and Iran.
His Dawa colleagues included Ibrahim al-Jaafari, who would later become his predecessor as prime minister, as well as al-Abadi, nominated as his successor.
While in exile in Syria, he began to use the pseudonym Jawad and became responsible for leading the party's "jihad office", which directed activists inside Iraq.
Al-Maliki returned from exile after Saddam's ouster and was named to a US-brokered consultative council in 2004. He was elected to parliament in Iraq's first post-Saddam balloting and was head of its Security and Defense Committee.
He also served on the committee responsible for purging many members of Saddam's Baath Party from senior posts. Sunnis, who formed the backbone of the party, particularly resented the committee's work and saw it as a tool that sidelined them.
He ascended to the premiership after al-Jaafari, under criticism for rising violence, failed to win parliamentary support for another term after 2005 elections.
Al-Maliki had established himself as a hard-liner when it came to battling the insurgency that pushed Iraq to the brink of civil war as he took office. He stood beside US officials to announce the death of Abu Musab al-Zarqawi, the most notorious al Qaeda leader in Iraq. US bombs had killed the militant chief, but its timing and al-Maliki's praise for the security forces that he said aided the raid reinforced his anti-terrorist message.
Before the year was out, al-Maliki signed the execution order for Saddam. The move delighted Iraqi Shiites and Kurds, who suffered under the dictator's rule, but leaked audio of guards taunting Saddam at the gallows angered many Sunnis.
Some Shiites later soured on him after he joined US forces in an offensive against cleric Muqtada al-Sadr's Mahdi Army militia in the southern city of Basra. But the move helped bolster al-Maliki's image as a national, rather than solely sectarian, leader.
His political bloc, which grouped Dawa and other smaller parties into the State of Law coalition, faced a strong challenge from the Sunni-backed but largely secular Iraqiya bloc in 2010 elections. Although Iraqiya won two more seats, al-Maliki stayed in power by a court ruling that the largest bloc of parties cobbled together - not the largest single party - had the mandate to form a government.
But opposition grew to his governing style, and questions arose over whether he was unfairly consolidating power and intimidating or sidelining political opponents.
Al-Maliki oversaw efforts - too slow for many - to rebuild Iraq and normalise its relations with the outside world. He struggled to balance ties with the United States and neighbouring Shiite powerhouse Iran. Critics said he was too cozy with Tehran, but he argued it was vital to maintain good relations.
He and Bush talked frequently, but they failed to secure terms to allow a continued US military presence in Iraq beyond 2011. The last American troops left in December 2011, except for a small number that stayed under the control of the US Embassy to provide training and facilitate arms sales.
The departure of US troops marked a turning point that al-Maliki swiftly sought to exploit for political gain.
His governing style alienated many in parliament, as well as his own deputies and ministers. Al-Maliki contended he was acting in the best interest of Iraq and doing what he could in the face of an unco-operative opposition.
By late 2012, he faced renewed challenges to his authority. Iraq's self-rule Kurdish region rushed troops to its disputed internal border with the rest of Iraq, where they faced off against the Iraqi army. Anti-government protests erupted in Anbar province and other largely Sunni areas that lasted for months.
Although violence had declined from its peak in 2006-07, mass-casualty attacks continued. In January 2014, militants with the group known then as the Islamic State in Iraq and the Levant swept in from neighbouring Syria and mounted an offensive in Anbar province, taking Fallujah and parts of Ramadi. These became the base for a wider, more violent campaign that included the second-largest city, Mosul.
That prompted uncharacteristically outspoken criticism from Iraq's most revered Shiite authority, Ayatollah Ali Sistani, causing many to believe al-Maliki's days were numbered.
"The Mosul events made it very difficult for al-Maliki to remain prime minster," said Ayham Kamel, an Iraq expert with Eurasia Group. "But Sistani's direct involvement is really what made a difference here."
Mahmoud Othman, an independent Kurdish lawmaker, said al-Maliki was not solely to blame for failures in leadership.
"The parliament and the presidency also failed," Othman said. "He made the lawmakers his enemies instead of making them his partners. Under al-Maliki's rule, the judicial authorities and the army have lost their independence and neutrality and were turned to tools in the political games in Iraq."