In this image provided by the U.S. Air Force, a C-17 transport aircraft conducts combat airlift operations for U.S. and coalition forces in Iraq and Syria on April 13, 2018. (Tech. Sgt. Gregory Brook/AP)

The U.S. military disbanded the command overseeing American ground forces in Iraq on Monday, as the Pentagon ends major combat operations against the Islamic State in the country but looks to maintain a longer-term troop presence there to prevent the extremists from regrouping.

U.S. Central Command, which oversees military operations in the Middle East, marked the deactivation of the command in Baghdad with a ceremony, calling the event an acknowledgment of the “changing composition and responsibilities of the coalition” the United States assembled nearly four years ago to destroy the Islamic State.

The Combined Joint Forces Land Component Command oversaw troops from the U.S.-led coalition as they helped Iraqi forces roll back the Islamic State’s self-declared caliphate.

While the command’s closure marked a milestone in the fight against the militant group, U.S. officials say the battle isn’t finished.

The equivalent-level special operations task force the U.S. military is using to finish off the Islamic State in Syria remains active, as does the higher-level command that oversees the broader campaign against the Islamic State in both countries.

President Trump has been vocal about bringing home the roughly 2,000 U.S. troops fighting the Islamic State from Syria as soon as possible. But he has said little about withdrawing more than double the number of American forces still deployed to Iraq, in what many in Washington have read as a desire by the White House to avoid disrupting upcoming Iraqi elections.  

Defense Secretary Jim Mattis said in Senate testimony last week that he would support keeping a residual U.S. force in Iraq alongside other troops from North Atlantic Treaty Organization nations to help maintain security in the country, with a phased withdrawal over time based on certain conditions.

U.S. military commanders fear that if American troops withdraw sooner than they should, the Iraqi government could again prove unable to defend the country from a possible renewed Sunni insurgency emanating from the remnants of the Islamic State.

The extremist group was fueled in part by feelings of marginalization among Iraqi Sunnis, who dominated the nation before Saddam Hussein’s ouster in 2003 and still largely feel underrepresented under the current Shiite-led government, which faces elections May 12. 

Trump hasn’t weighed in publicly on the possibility of keeping a residual U.S. force in Iraq. For weeks, however, he has pushed for a full-scale withdrawal from Syria where, unlike in Iraq, American forces operate without the government’s permission. 

The ground troops were there to advise, equip and assist Iraq’s military during the grueling three-year fight to claw back the one-third of Iraqi territory that the Islamic State had claimed. Technically, U.S. troops were not involved in active combat but were often seen near field command centers on Mosul, operating surveillance drones or coordinating battlefield logistics with Iraqi commanders. 

Since Iraqi Prime Minister Haider al-Abadi declared the Islamic State defeated last December, American forces have been gradually drawing down while shifting their tasks to the training of Iraqi forces in intelligence gathering and policing. 

Officially, the Pentagon says about 5,200 American troops are deployed to Iraq, but it is not fully clear how many are in the country on any day, given the way the U.S. military tabulates and releases the numbers.

One reason American officials have been vague about the number of forces in the country is that they believe publicizing the figures could adversely impact the elections, said a senior American official who spoke on the condition of anonymity to discuss sensitive negotiations. 

Their presence has been a wedge issue in the elections. Abadi has said he wants the troops to stay to facilitate the rehabilitation of Iraq’s security forces, even as his opponents in the influential Shiite militias — some of which are aligned with Iran — have demanded the Americans leave immediately. 

A spokesman for Abadi has declined to say how many U.S. troops the prime minister sees as appropriate for the mission of ensuring the Islamic State does not rebuild itself. 

The statement Monday from Centcom did not give any clues regarding troops levels, saying only that the ground mission has been “consolidated under a single headquarters, reflecting the Coalition’s commitment to eliminate unnecessary command structures.”

Maj. Gen. Walter E. Piatt, the former commander of the land forces, said in the statement that authority over the troops will be handed over to the Combined Joint Task Force — the three-star headquarters that coordinates all anti-Islamic State operations, including airstrikes. While significantly reduced in frequency and pace, U.S. jets continue to hit Islamic State targets in Iraq and Syria.

A spokesman for Iraq’s military, Brig. Gen. Yahya Rasoul, hinted at the Iraqi government’s desire to see American forces stay. 

“We look forward to taking the partnership forward with the Combined Joint Task Force, and a friendship that will endure for years to come,” he said in the statement. 

In recent weeks, the Islamic State has stepped up its claims of attacks in areas north and west of Baghdad as the group’s spokesman made an explicit threat last week to disrupt the May elections. 

Sonne reported from Washington.