The Iraqi Parliament voted on Wednesday night to approve the government of Mustafa Al Kadhimi, ending weeks of political deadlock.
More than 250 members attended the session in Baghdad and voted in 15 ministers while rejecting five – those for trade, justice, culture, agriculture and migration.
"My Cabinet has earned Parliament’s support and we will work to earn the trust and support of the Iraqi people," Mr Al Kadhimi tweeted.
"I am grateful to those who worked with us to form the government."
"I urge all political actors to come together around a national programme to serve Iraq's interests."
During his address to Parliament he pledged to hold transparent and early elections, to restrict access to weapons and to curb corruption.
"This is a government that will provide a solution, not add to the crises," Mr Al Kadhimi said.
"This government has come as a response to the social, political and economic crisis our country is facing."
Members voted in Juma Anad, the land forces commander, as defence minister, and Othman Al Ghanmi, the chief of staff for the armed forces, as interior minister.
Ali Allawi, a historian and politician, was approved to become the finance minister.
Mr Al Kadhimi's government must tackle an economic crisis brought on by oil price crashes, and cope with the coronavirus pandemic.
His government pledges to fight corruption by promoting integration among institutions, to “provide them with the powers to implement necessary laws” and to start auditing financial records.
Mr Al Kadhimi's other priorities are allowing weapons only under the government’s control and returning people displaced by Iraq's conflicts to their homes.
He said his plan would be to end foreign interference and “not allow any country to violate Iraq’s national sovereignty”.
The plan also aims to check the power of armed militias operating outside the state.
President Barham Salih said the process of forming a government "must be completed as soon as possible to meet Iraq's health, economic and security challenges".
Before the session, Mr Al Kadhimi tweeted that he secured “the best candidates for each portfolio, who are able to create consensus and work together to benefit all Iraqis".
Several members of Parliament representing the oil-rich city of Basra boycotted the session.
They claim that Mr Al Kadhimi’s Cabinet “does not represent them”, after their request to be given the oil and transport ministries was turned down.
The members said their city contributed to "95 per cent of government revenues" but they had no real Cabinet representation.
Some Kurdish politicians also boycotted the session.
"It seems that he doesn't understand Kurdish politics," Sarkwat Shams, one of the Kurdish politicians who left the meeting, told The National.
"Kadhimi has no idea what he is doing. We met him and felt he has no real strategy to tackle the current issues."
Martin Huth, the EU ambassador to Iraq, said he was following the session with “great interest”.
"We wish all the best for Iraq – sovereignty, prosperity, stability and progress,” Mr Huth said.
For almost six months, Iraqi politicians have wrangled over the shape of their new government.
Mr Salih proposed Mr Al Kadhimi, a former intelligence chief who does not belong to any political party, for the position in early April.
He is the third nominee in 10 weeks to try to form a government as the country struggles to replace departing prime minister Adel Abdul Mahdi, who resigned last November after months of deadly street protests.
Mr Al Kadhimi’s proposed government had reasonable prospects of securing approval after weeks of political negotiations.
But the interests of the country's ruling political blocs have stood in the way of several of his nominated candidates.
Pro-Iranian parliamentary blocs withdrew their support for Mr Al Kadhimi a fortnight ago after they reversed their initial position of no objection to his appointment and chosen ministers.
Mr Al Kadhimi indicated at the end of April that he was facing serious difficulties in forming his Cabinet. He urged the political blocs to unite and put their differences aside.
Mr Al Kadhimi said the government he was trying to form “has to be up to the crisis” and that he rejected “any pressure aimed at undermining the state”.
Wednesday's session was the first to be held since the country imposed a nationwide curfew to contain the spread of the coronavirus.
Politicians were urged to wear masks and gloves and were checked when entering the building.
Seating for members was arranged to follow social-distancing regulations, with a seat left vacant in between.