When Haider al-Abadi was tasked with forming a new Iraqi government in August 2014, just weeks after a lightning offensive by the Islamic State group, many believed he would fail.
Three years later, the stocky prime minister with a close-cut white beard has transformed what many in Iraq considered "mission impossible" into a success story.
He has rebuilt the crumbling armed forces, chased IS from more than 90 percent of territory it had seized -- around a third of Iraq -- and retaken disputed areas in the north from Kurdish peshmerga fighters.
"The standard view of Abadi was that he was indecisive, weak and bit too conciliatory for Iraqi politics," says Fanar Haddad, a research fellow at the Middle East Institute of the National University of Singapore.
When Abadi took over from Nuri al-Maliki he faced huge challenges, including rampant corruption, poor infrastructure, falling oil prices and the jihadist threat.
Abadi was up against "the world's hardest job", says Sajad Jiyad, director of the Baghdad-based independent Al-Bayan Centre for Planning and Studies.
But dressed in military garb or suit and tie, Abadi over time announced several military victories while trying to battle corruption by rolling out sweeping reform.
His policies won him supporters.
"He is the best prime minister in Iraq's history. He speaks little but acts a lot," one of Abadi's 2.5 million followers on Facebook recently wrote.
Analysts say Abadi has succeeded where other Iraqi premiers failed.
"His calm and conciliatory manner and his openness to dealing with a broad array of actors (inside and outside Iraq) stand in stark contrast to his predecessor," says Haddad.
A recent survey carried out by an Iraqi polling institute found the Shiite premier has a "75 percent approval rating", even including Iraq's Sunni minority, Jiyad notes.
- From exile to politics -
A member of the Dawa party, Abadi was born in 1952 in a wealthy Baghdad district but lived in exile for much of Saddam Hussein's rule, including in Britain where he earned a doctorate in engineering from the University of Manchester.
Two of Abadi's brothers were arrested and executed by Saddam's regime for membership of the Dawa party, which opposed his rule, while a third was imprisoned for a decade on the same charge.
Abadi returned to Iraq after Saddam's overthrow in 2003 and was communications minister in the interim government set up after the dictator's fall.
In 2006 he was elected to parliament, chairing an economy, investment and reconstruction committee and then a finance committee.
He was voted deputy parliament speaker in July 2014, before being tapped to form the government a month later.
Perhaps his greatest accomplishment since then was to rebuild the Iraqi police and army which had been weakened by decades of conflicts, including the 2003 US-led invasion.
Abadi succeeded in remobilising tens of thousands of force members with help from Iraq's allies, including the United States, which stepped in to train and equip them.
Under his command, Iraq's forces chased IS jihadists from more than 90 percent of the territory they had seized, dealing a major blow to the group's self-proclaimed "caliphate".
And earlier this month, Iraq's army retook Kurdish-held positions in and around Kirkuk province, outside the autonomous Kurdish region of northern Iraq.
- International player -
These achievements have transformed Abadi into a hero, almost worshipped by many Iraqis.
"Today there seems to be a bit of a cult following growing around Abadi," says Haddad.
"One hopes it doesn't go to his head; after all, Maliki in 2008-2009 was in a similar place to where Abadi is today," he adds.
Analysts say Abadi won the day thanks to his step-by-step approach.
He also embarked on a battle against corruption and under his tenure several officials have been arrested and tried for graft.
Jiyad notes that Abadi also "deftly positioned Iraq on the international stage" and succeeded in securing the support of international allies.
Diplomats based in Baghdad describe Abadi as someone who knows how to establish himself and command respect.
On Sunday, Abadi visited Saudi Arabia in a bid to ease years of tension between Shiite-majority Baghdad and the Sunni-ruled kingdom.
The trip -- which Haddad says would have been "unthinkable" under Maliki -- is seen as another diplomatic coup for Abadi, whose government is allied with Saudi rival Iran.
But despite his many achievements, "it is important to recognise the limits on what Abadi can do", says Haddad.
Iraq, he says, faces "gargantuan challenges", including reconstruction and the issue of people displaced by fighting, "that are beyond the control of any one actor".
© 2017 AFP