Iraq is marking the withdrawal as a restoration of sovereignty. But McMaster, who commanded U.S. Troops in the country and later served as President Trump's national security adviser, told NPR's Morning Edition the pullout comes as the United States and Israel are at war with neighboring Iran.

"I think it's not the right time," McMaster said. "This is going to embolden, I think, the Iranians to a certain extent, and it's not clear that there has been the enduring defeat of ISIS."

McMaster spent 34 years in the Army before advising Trump on national security during his first term. His warning lands as a direct challenge to the framing coming out of Baghdad, where officials are treating the exit as a win for Iraqi independence.

For Iraq, the stakes are immediate. A weakened U.S. Presence changes the calculus for Iran's influence next door and raises questions about whether the militant group that once seized huge swaths of Iraqi territory could find room to regroup.

A general who once led American troops into Baghdad now says the fight might not be finished.