WASHINGTON — Over the past four years, American military planning in Iraq has counted on working with Prime Minister Haider al-Abadi, a moderate Shiite Muslim who has managed to rebuild the country’s army, restore sovereignty and partner with both the United States and Iran to defeat the Islamic State.
But the results of the weekend’s national elections in Iraq have torn the American assumptions asunder.
Huge gains in Parliament were made by a party led by the anti-American cleric Moktada al-Sadr, whose implacable opposition to the presence of United States troops in Iraq was a top reason Washington withdrew its combat forces in 2011.
Now, President Trump and the Pentagon must decide whether the United States can move ahead with plans to leave a residual force of about 4,500 American troops in Iraq after the war against the Islamic State.
The group, also known as ISIS, is largely gone from the areas of Iraq that it occupied as recently as last year. But military planners are all too aware of what happened after the American troops left in 2011, opening space for the Islamic State’s rise as it was fueled by minority Sunnis who were alienated by the ruling Shiite government of Nuri Kamal al-Maliki, then the prime minister.
In 2014, the Islamic State rolled across Iraq, easily defeating the country’s army and controlling much of its northern and western regions. Ensuring that history is not repeated is a top American priority, senior State Department and Pentagon officials said.
For the Trump administration, that means trying to find a way to a working relationship with Mr. Sadr. Administration officials sought this week to focus on positive aspects of the election.
“Not that long ago, ISIS had controlled large swaths of that country,” said Heather Nauert, the State Department’s spokeswoman. “And the fact that they were able to pull off elections that were relatively free of violence is certainly a pretty amazing feat and a testament to the Iraqi people.”
Defense Secretary Jim Mattis told reporters that Trump administration officials “stand with the Iraqi people’s decisions.”
“It’s a democratic process at a time when people, many people, doubted that Iraqis could take charge of themselves,” Mr. Mattis said on Tuesday.
As a young man, Mr. Sadr led a Shiite militia that targeted American troops in Iraq. He fled to Iran to study in Qom, a revered Shiite religious center, before returning to Iraq in 2011 as a cleric and strident Iraqi nationalist. Mr. Sadr is not expected to hold elected office in Iraq; rather, his power comes from his pulpit.
Given Iran’s outsize and yearslong influence in internal Iraqi politics, foreign policy experts said the Trump administration might have already made things more complicated for itself in Baghdad.
Mr. Trump’s decision last week to withdraw from the Iranian nuclear accord has frozen relations between Washington and Tehran after a thaw that, among other issues, had helped facilitate an indirect partnering against the Islamic State in Iraq.
Iran now “has no motivation for a leader in Iraq who would be positive toward the United States,” said Vali Nasr, the dean of the Johns Hopkins School of Advanced International Studies.
But Pentagon officials are betting that Iran also does not want to see a return of the Islamic State.
There is widespread agreement among Shiite political blocs, with whom Mr. Sadr would have to ally to form a government, to continue a program backed by international troops to train and equip Iraqi security forces. Trainers include American, Italian and Spanish advisers, with equipment paid for by the United States. And having NATO serve as the public representative for the American-led mission in Iraq could serve as a workaround for Mr. Sadr’s sensitivities, officials say.
Should the Trump administration and a government loyal to Mr. Sadr align, it would not be the first time American troops have had to develop a working relationship with Iraqis who were once considered the enemy. The partnering of United States forces with Sunni insurgents known as Sahwa, or the Awakening, against Al Qaeda in Iraq was a defining turning point in the war more than a decade ago.
But the Pentagon will have its own balancing act to perform back in Washington. Mr. Trump has already expressed his desire to bring American troops home soon from Syria; officials said the president has given the Defense Department six months to wrap up its mission there. Military officials had hoped that an American troop presence in Iraq could keep in contact with allied forces across the border in Syria.
And what would Mr. Trump do if Mr. Sadr again demands an American troop withdrawal from Iraq?
“The Pentagon is already on the clock to get out of Syria,” said Derek Chollet, a former senior Defense Department official in the Obama administration. “Who’s to say what happens in Iraq after?”
Margaret Coker contributed reporting from Baghdad.