Iraq's lawmakers have approved a new government, after six months without one, as parties squabbled until the last minute over cabinet seats in backroom deals.
Prime Minister Mustafa al-Khadimi, Iraq's intelligence chief and a former journalist, will head the government but will begin his term without a full cohort of ministers after several candidates were rejected, reported Al Jazeera.
Former Prime Minister Adel Abdul Mahdi, who has been leading a caretaker administration, resigned last year after thousands took to the streets calling for the departure of Iraq's ruling elite accused of driving the country into dysfunction and economic ruin.
The battle over government portfolios since Abdul Mahdi's resignation in November prevented two previous nominees for prime minister from forming a cabinet.
Kadhimi's candidates for cabinet posts including interior, defence, finance and electricity passed with the support of the majority of legislators present.
Voting on the oil and foreign ministries was delayed as the parties failed to agree on candidates. They rejected Khadmi's choices for justice, agriculture and trade.
"The security, stability and blossoming of Iraq is our path," Kadhimi wrote on his Twitter account after parliament voted for his cabinet.
He said his priorities would be tackling the coronavirus pandemic and holding to account those who killed protesters in previous months of anti-government unrest.
Iraqi officials say Kadhimi is acceptable to the United States and Iran whose battle for influence over Iraq has boiled into an open confrontation in the past year.
The US killed Iranian military leader Qassem Soleimani and his close ally, the Iraqi paramilitary leader Abu Mahdi al-Muhandis in a drone strike next to Baghdad International Airport in January.
Iran responded with its first-ever direct missile attack against US forces at a base in Western Iraq several days later but there were no casualties.
The US accuses paramilitary groups backed by Tehran of carrying out a series of rocket attacks on other bases in recent months, one of which killed three troops in the US-led military coalition based in Iraq.
Rockets have regularly been fired near the US embassy in Baghdad. None of the rocket attacks has been claimed by known Iran-backed groups.
Al-Kadhimi's government must deal with an impending economic crisis precipitated by the coronavirus pandemic, which has caused the prices of oil - Iraq's principal source of revenue - to plummet.
It also faces a growing ISIL (ISIS) armed uprising as the hardline group steps up attacks on government troops from hideouts in remote areas of northern Iraq.
Iraq risks being caught up in any regional conflagration between Washington and Tehran, as militia groups promise revenge for the killing of Soleimani and al-Muhandis and President Donald Trump continues his bellicose rhetoric against Iran.