Iraqi Prime Minister Nouri Maliki has resigned, in a move observers hope will end a political crisis in Baghdad.
Haider al-Abadi, a deputy speaker of parliament, has been asked by Iraq’s president to form a government.
Mr Maliki’s earlier refusal to resign after eight years in power had been blamed for deepening the crisis. The UN and US have welcomed his resignation.
The government has been unable to stop Islamist fighters from seizing vast areas in northern Iraq.
The offensive by the self-styled Islamic State (IS), a Sunni Muslim jihadist group formerly known as Isis, has triggered a security and humanitarian crisis, driving an estimated 1.2 million Iraqis from their homes.
Appearing on state TV flanked by Mr Abadi and other politicians from the Shia Muslim majority, Mr Maliki spoke of the grave “terrorist” threat from IS before announcing his own exit.
“I announce before you today, to ease the movement of the political process and the formation of the new government, the withdrawal of my candidacy in favour of brother Doctor Haider al-Abadi,” he said.