“What is clear is that we will be successful,” President Obama said Tuesday during his first White House meeting with Iraqi Prime Minister Haider al-Abadi. (Mandel Ngan/AFP/Getty Images)

President Obama hailed Iraq’s prime minister on Tuesday as the kind of leader who could finally unite a fractious nation, and help America leave, after 11 years of war.

“What is clear is that we will be successful,” Obama said during his first White House meeting with Haider al-Abadi. “And part of that success is Prime Minister al-Abadi’s commitment to an inclusive government.”

Abadi, sitting across from Obama in the Oval Office, occupied virtually the same spot that his predecessor, Nouri al-Maliki, filled four years earlier. Back then, Obama hailed Maliki for leading “Iraq’s most inclusive government yet.”

But it didn’t take long for that relationship to sour. By last fall, senior Obama administration officials were blaming Maliki’s divisive, corrupt and sectarian rule for giving rise to the Islamic State in Iraq’s Sunni heartland.

U.S. presidents, generals and diplomats have spent much of the past decade in Iraq and Afghanistan searching — sometimes desperately — for strong, democratic leaders who could forge stability or broker peace in countries battered by years of repression and war. For Obama, who is intent on ending America’s wars before leaving office, the pressure to find the right partners has been especially intense.

Today he’s starting fresh with new leaders in both countries, where a strikingly similar dynamic prevails. In Afghanistan, President Ashraf Ghani, a former World Bank executive who studied at Columbia University, took over last year from Hamid Karzai, whose relationship with the Obama administration had become toxic. “This visit is an opportunity to begin a new chapter between our two nations,” Obama said last month when he met with Ghani in the White House.

In Iraq, the White House has pinned its hopes on Abadi, who spent more than 20 years studying and working in London. Since taking office last August, senior White House officials said, Abadi, a Shiite, has managed to broker compromises with minority Sunnis and Kurds that would have been unthinkable under his predecessor. He cut a deal with the Kurds to share oil revenue, reestablished relationships with Sunni Arab neighbors such as Saudi Arabia, and has shaken up the leadership of the Iraqi army, which collapsed under pressure from Islamic State fighters last summer.

Obama on Tuesday said the United States would deliver $200 million in humanitarian aid to help Iraqis displaced by war. Abadi, who was seeking financial assistance and weapons to battle the Islamic State, thanked the president for his help. “Iraq has managed . . . to liberate a large part of its territory with support from the coalition but especially from the United States,” he said. American assistance, he added, “has had the greatest impact.”

Repeating a pattern

The renewed hopes and happy start reflect a pattern in these notoriously fraught relationships, in which America’s impatience to end wars collides with messy politics on the ground. “Sink or swim with Ngo Dinh Diem” described President John F. Kennedy’s strategy in Vietnam, until the CIA backed a coup that led to Diem’s death. In Nicaragua, President Franklin Roosevelt allegedly said of Anastasio Somoza García: He “may be a son of a bitch, but he’s our son of bitch.” A few decades later, the United States dropped its support for his rule.

“The remarkable thing is to find a case where the relationship went smoothly,” said Phil Zelikow, a historian at the University of Virginia and counselor to former secretary of state Condoleezza Rice. During his time in the George W. Bush administration, Zelikow said, he looked for examples of such comity. The only example he could find was the Philippines in the 1950s.

Some critics say the heavy focus on and high expectations for the top leader blind U.S. policymakers to the broader problems in broken societies. In Iraq, Abadi inherited a weak and corrupt government that exists mainly to dole out the country’s oil revenue via patronage networks. His army and police forces are often outgunned by powerful Shiite militias, some of which are backed by Iran. He has struggled to find credible negotiating partners in Iraq’s fractured Sunni minority, which has backed the Islamic State.

“Abadi may have a better personality than Maliki, and he may have the will,” said Emma Sky, a former political adviser to the top U.S. general in Iraq and the author of “The Unraveling.” “But he’s subject to the same constraints. He needs to survive, just like Maliki did before him.”

When Obama entered the White House in 2009, he said he would adopt a new relationship with the leaders of Iraq and Afghanistan. Bush had conducted biweekly teleconferences with both Karzai and Maliki, saying his regular coaching and mentoring were critical to their success. Obama scaled the calls back dramatically, reasoning that his words would carry greater weight if he weren’t talking to the Afghan and Iraqi leaders so often.

At the time, Maliki had surprised American officials by ordering his army to launch attacks on the Mahdi Army, a Shiite militia that had inflicted heavy losses on U.S. troops. In 2010, the Obama administration helped Maliki hold onto his job amid a post-election power struggle. “Keeping Maliki seemed the easiest thing,” Sky said. “It required the least effort.”

The Islamic State’s blitzkrieg through Iraq last summer led to Maliki being pushed from power. Abadi, a unknown compromise candidate, was elevated. Only a few weeks ago, doubts were growing in Washington about whether he was strong enough to pull Iraq back from the brink. One moment in Tikrit seemed to crystallize his weakness: Iranian-backed Shiite militias launched a unilateral attack against Islamic State rebels, stoking anxiety that the prime minister lacked the political muscle to curb the renegade militia’s rise. The U.S. military was told that its help in freeing Tikrit was neither necessary nor welcome.

But when the militia attack bogged down amid heavy casualties, U.S. officials said, Abadi took control, asking for help from U.S. warplanes and ordering government forces to take back the town.

“Prime Minister Abadi stepped up,” Vice President Biden said in a speech last week. “He courageously stepped in, making it absolutely clear that the Iraqi government — him, as commander in chief — was in charge of the operation.”

Some White House officials are even more effusive in their praise for the Iraqi premier. “I think Abadi is turning out to be the leader we could not have imagined,” said a senior official, speaking on the condition of anonymity to discuss a foreign leader. “He’s so far advanced from Maliki as to be incomparable.”

Complicated expectations

The success, however, has come with a downside: increasingly problematic expectations from Washington. U.S. commanders suggested that they had conditioned American support for the attack on the Shiite militias not being involved.

“I will not, and I hope we never, coordinate or cooperate with the Shia militias,” said Gen. Lloyd Austin III, head of U.S. Central Command. Some of the Shiite paramilitary groups had close ties to Iran. Others consisted of local fighters who heeded calls to defend their country.

To some in Baghdad, it appeared as though Abadi had sided with the U.S. military over Iran and his own Shiite supporters, who were fighting and dying to save Tikrit.

Those tensions, however, weren’t apparent Tuesday in the Oval Office, where Abadi praised America’s sacrifices for the sake of Iraq. “The blood of its sons and daughters is mixed also with the blood of the Iraqis,” he said. “I can assure you that these sacrifices will not go to waste.”

More than 7,000 miles away, Iraqi troops were on the move against Islamic State fighters. U.S. weapons were flowing faster. A tense, complicated relationship was still in its honeymoon phase.

Missy Ryan contributed to this report.