After mostly avoiding getting dragged into the partisan fights between President Trump and his opponents, the U.S. military faced an uncomfortable reality this month: There’s no easy escape from Washington’s battles.

Thousands of troops were moved to the U.S.-Mexico border just before the midterm elections as Trump warned of a looming “invasion,” even as his critics cautioned that the decision was a campaign ploy. And just as it was reported Monday that some of those soldiers may be ordered back from the border in the coming days ahead of most migrants’ arrival there, Trump escalated a separate spat that may further infuriate advocates of a politically independent military.

Over the weekend, the commander in chief took aim at retired Adm. William H. McRaven — one of the military’s most revered Navy SEAL and Special Operations commanders who oversaw the killing of Osama bin Laden and the capture of Saddam Hussein.

Deriding him as an “Obama backer,” Trump told Chris Wallace on “Fox News Sunday”: “Wouldn’t it have been nice if we got Osama bin Laden a lot sooner than that? Wouldn’t it have been nice?”

Undeterred by the criticism that ensued after his verbal attack, Trump doubled down in several tweets Monday in which he lashed out at Pakistan, where bin Laden hid for years. “Of course we should have captured Osama bin Laden long before we did,” he wrote.

Bin Laden was killed in a U.S. military operation in 2011, a couple of years before another man was getting ready to claim his role as leader of the world’s most feared terrorist group: Abu Bakr al-Baghdadi, self-declared caliph of the Islamic State. Baghdadi’s death has been reported multiple times since the Islamic State’s territorial retreat sped up in 2016, but audio recordings suggest that he is still alive.

But despite Trump’s attacks on his predecessors and U.S. military leaders over bin Laden, there is one question Trump has not publicly asked since assuming office: Where is Baghdadi, and why hasn’t he been captured?

Some of the most recent intelligence by U.S.-allied partners in the region suggests that any answer would involve the painstaking and years-long work that is almost always needed to track down top militant commanders such as bin Laden or Baghdadi.

A senior commander with Iraq’s elite U.S.-trained Counter Terrorism Service, the nation’s most effective group fighting the Islamic State, said in an interview with The Washington Post last week that Baghdadi is probably suffering from injuries sustained over the past four years and is limited in his movements. The commander said Iraq’s latest intelligence indicates the militant leader is moving between the sparsely populated desert regions that straddle Syria and Iraq’s borders in areas that have yet to be secured by Iraqi or Syrian forces.

Despite losing the territory it controlled in Iraq by December 2017, the Islamic State still maintains pockets of influence along the lengthy border with Syria and in villages inside Iraq’s Sunni heartland. The group has recently mounted low-level terrorist attacks in places from which it has been evicted, such as Mosul, Ramadi and Tikrit.

Both bin Laden and Baghdadi have succeeded in erasing most of their traces. While bin Laden was involved in the day-to-day operations of his al-Qaeda group before the Sept. 11, 2001, attacks, the subsequent U.S. focus on capturing or killing him forced him to become a more subdued and symbolic figure. Keeping a low profile, bin Laden worked on a broad strategy for the group. Baghdadi has kept an even lower profile, with only one public appearance even before a U.S.-led coalition intervened in Syria and Iraq.

The intervention — which has mostly consisted of airstrikes and some U.S. ground forces operations inside Syria and Iraq — was launched under President Barack Obama and continued by Trump. While Trump has publicly pondered withdrawing ground troops, he has not followed through, heeding the advice of top military commanders.

Human rights organizations have cautioned that the U.S.-led operation, which has been celebrated in the United States as a military success, “took a horrendous toll on civilians” in formerly Islamic State-controlled cities such as Raqqa in northern Syria. Although it helped local forces win back about 95 percent of territory previously held by the Islamic State, some of the group’s top leaders remain at large.

With the Islamic State turning into a more guerrilla-style terrorist group, tracking the militants down may not become easier. American and allied Syrian and Iraqi forces have been slow to transition from combat to the more intensive intelligence operations needed to target the clandestine Islamic State remnants.

The last time the Islamic State claimed to have released an audio message by Baghdadi was in August, to mark the Muslim Eid al-Adha holiday and to urge the group’s sympathizers to keep up the fight. The Islamic State leader had been silent for almost a year before the 54-minute August address.

“The scale of victory or defeat . . . is not tied to a city or village,” he said in August.

Amid U.S. and U.N. estimates that up to 30,000 Islamic State supporters could still be in Iraq and Syria, his message likely also applies to U.S. efforts to locate the city, village or remote stretch of land where Baghdadi may be hiding.

More on WorldViews: