Members of the Iraqi rapid-response forces inspect a hospital damaged by clashes during a battle between Iraqi forces and Islamic State militants in the Wahda district of eastern Mosul, Iraq, on Jan. 8. (Alaa Al-Marjani/Reuters)

As President-elect Donald Trump prepares to take office, the Islamic State is on the defensive in three countries and has been all but wiped out in another. Two and a half years after the extremists rolled across northern Iraq, Pentagon and diplomatic officials say a military victory, at least in their major strongholds, is within sight.

But tens of thousands of fighters remain, and the militants are showing signs of reinventing themselves as a dispersed terrorist movement — a threat that the incoming commander in chief says has been given too much time to grow.

“This should have been over with quickly,” Trump told CNN last year. “We’re not fighting strongly enough. We have to end it.”

While Trump has promised a more effective military campaign than that of his predecessor, many of the actions he might take to accelerate progress in Iraq and Syria come with toxic side effects. Those include the potential worsening of already frayed ties with NATO ally Turkey, an increase in U.S. or civilian casualties or reinvigorated militant recruitment.

“I think they’ll find there’s not a lot of low-hanging fruit, by which I mean obvious and low-cost things to do that will noticeably advance progress without negative or unintended consequences,” said Philip H. Gordon, who served as President Obama’s coordinator for Middle East issues when the Islamic State captured the Iraqi city of Mosul in June 2014, an event that stunned U.S. officials and upended the president’s national security plans.

[U.S. military aid is fueling big ambitions for Syria’s leftist Kurdish militia]

Obama administration officials credit their slow-and-steady strategy, which has centered on local combat power backed by U.S. air support, for the gradual recapture of much of the territory held by militants across Iraq and Syria over the past two years.

U.S. air power has also dealt a blow to a potent Islamic State branch in Afghanistan and, last month, finished off the militants’ sole stronghold in Libya.

While Trump has spoken only in general terms about his plans, Pentagon officials are already preparing recommendations in anticipation of the changes that Trump and his designated Pentagon chief, retired Marine Gen. James Mattis, may want to make.

Speaking in his confirmation hearing, Mattis told lawmakers that the current plan for recapturing Raqqa, the Syrian city where the Islamic State, also known as ISIS, has plotted external attacks, “needs to be reviewed and perhaps energized on a more aggressive timeline.” But he, like Trump, provided few details on what steps he might take.

U.S.-backed Syrian fighters are seeking to encircle Raqqa, supported by members of an American Special Operations force of about 500 troops. But U.S. reliance on the Syrian Democratic Forces, a Kurdish-dominated group, in the lead-up to the Raqqa battle has already created deep strains with Turkey, which views the Kurdish fighters as a threat to its own security.

Robert Ford, a former U.S. ambassador to Syria, said the United States has already laid the groundwork for lasting conflict in Syria by empowering the YPG, a Kurdish group that is at odds not only with Turkey but also with much of Syria’s Arab majority.

Members of the Iraqi special forces advance in Mosul’s Zahraa neighborhood on Jan. 7 during an ongoing military operation against the Islamic State. (Dimitar Dilkoff/AFP/Getty Images)

The U.S. military has struggled since 2014 to build up a reliable, sufficiently large Arab force that can battle the Islamic State without exacerbating ethnic friction or fueling jihadist sympathies among Arabs opposed to Kurdish encroachment.

[The mounting death toll in Mosul forces questions about the battle plan]

But increasing support to the Kurdish forces may be one of the only options Trump can exercise to accelerate the Raqqa offensive, short of sending in U.S. troops to liberate the city. Obama administration officials have long mulled providing weapons directly to the YPG, and are continuing to consider that step, but have held off for fear of triggering a crisis with Turkey.

Ford warned against such a move, saying that only by providing support exclusively to Arab groups could the United States head off a more lasting, problematic conflict.

“In return for delaying six months, you’d have the chance of defusing the ethnic tensions that the Islamic State is sure to exploit in its soon-to-come insurgency,” said Ford, who is a senior fellow at the Middle East Institute.

The president-elect, who said that “Russia can help us fight” the Islamic State, has also suggested he might broaden military cooperation with Moscow in Syria. Over the past year, Russia’s support for President Bashar al-Assad has altered the trajectory of the war while, Western nations allege, indiscriminate Russian airstrikes have killed thousands of Syrian civilians.

But moving to establish a robust partnership with Russia in Syria will probably face significant resistance at the Pentagon. Last year, defense officials sought to block a proposal to expand cooperation with Moscow over Syria air operations, a move that Pentagon officials argued would give the Kremlin access to sensitive U.S. intelligence and operational information.

One area where Trump’s national security team may decide to dial things up is with the size of the U.S. force deployed in support of local troops in Syria and Iraq.

In Iraq, additional troops would mean more hands-on advisory capability for Iraqi troops who have taken heavy losses as they push their way deeper into Mosul. Obama has gradually increased the number of U.S. military personnel in Iraq to more than 6,000 U.S. troops today, most of whom serve in an advisory role away from the front lines.

[U.S. increases support for Turkish military operations in Syria]

Additional troops in Syria could mean more hands to recruit, train and advise Arab forces there ahead of the Raqqa offensive.

While military leaders will probably support modest increases to those advisory forces, proposals for any larger increase — many thousands or tens of thousands as Trump has suggested he might order — could lack military support.

Shaped by their repeated deployments in Iraq and Afghanistan, many of the senior officers leading the Pentagon have questioned the need to risk American lives in conflicts that may fail to bring about lasting change in the countries where they occur. They also worry about the antibodies that large U.S. deployments will produce, among Sunni extremists or Shiite militias.

The president-elect, promising during the campaign to “bomb the s---” out of the Islamic State,” will probably intensify the American air effort. Although the United States has conducted more than 13,000 strikes in Iraq and Syria since 2014, critics have assailed the offensive for proceeding more slowly than previous air campaigns.

Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, told reporters recently that air operations were limited only by the pace of ground operations, as American and allied officials seek to help local forces advance into militant territory.

But military officials have said they have already been hitting all the available militant sites, not just in areas where allied ground forces are active and are constrained primarily by strict rules about avoiding civilian casualties.

“There’s not much left to strike in many cases,” said a defense official, speaking on the condition of anonymity to discuss current operations. “The bottleneck in the chain is having targets to hit.”

Despite the restrictions, the U.S. Central Command has acknowledged the death of at least 188 people in U.S. strikes over Iraq and Syria, a figure that watchdog groups dispute as too low.

As a candidate, Trump espoused a cavalier attitude toward civilian deaths, saying he would “go after” family members of terrorists.

“I suspect . . . they will err on the side of possibly doing more, hitting more, and killing more, in order to go after ISIS,” Gordon said. “But there will be a cost.”

Read more:

Do campaign statements and tweets add up to a Trump foreign policy strategy?

The Iran nuclear deal may not survive a Trump administration

First sign of better U.S.-Russia relations: An invite to Syria talks