Iraq's intelligence chief was appointed the country’s third prime minister-designate in just over a month Thursday after the resignation of the most recent candidate amid political infighting.

The upheaval threatened a leadership vacuum at the helm of the government amid a severe economic crisis and viral pandemic.

Adnan Al-Zurfi's candidacy was imperiled in the past 48 hours when key Shiite parties rallied around Iraq's intelligence head, Mustafa al-Kadhimi, to replace him. His chances were further diminished when the main Kurdish and Sunni blocs withdrew support for his candidacy.

Iraq's president appointed Kadhimi, 53, as prime minister-designate shortly after Al-Zurfi's resignation.

“With my mandate to lead the Iraqi government, I pledge to my honorable people to work to form a government that puts the aspirations and demands of Iraqis as the top priority,” Kadhimi tweeted shortly after his appointment was announced.

Kadhimi was appointed by former Prime Minister Haidar al-Abadi as head of the Iraqi National Intelligence Service and has served in this post since June 2016.

Al-Zurfi faced stiff resistance from Iraq’s powerful Iran-backed political parties since his appointment in March.

In a resignation letter to Saleh, al-Zurfi cited “internal and external reasons” that prevented him from carrying out his duties as premier-designate. He had presented a government plan focusing on the economy, reconstruction and bringing arms under the control of the state, but fell short of producing a Cabinet lineup to parliament.

“I offer my apologies first to everyone who put their trust in us,” the letter said.

Al-Surfi is the second premier hopeful to withdraw since caretaker Prime Minister Adil Abdul-Mahdi resigned in December under pressure from mass protests. Mohammed Allawi, a former communications minister, stepped down last month, citing obstruction from political parties and after failing to garner support for his proposed Cabinet.

Kadhimi, who is backed by parties across Iraq's fragmented political scene, is unlikely to face the same set backs as Allawi and al-Zurfi.

According to Iraq's constitution, he has 30 days to present a Cabinet lineup to parliament.