BAGHDAD — The Islamic State has been stripped of nearly all the territory it ruled in Iraq and Syria and has been pummeled by nearly 30,000 airstrikes. But the extremist group has still managed to retain a small pocket of land on the Syria-Iraq border for more than a year.

The militants have even on occasion struck back with some of their former vigor from their toehold, around the Syrian town of Hajin in Deir al-Zour Province. In the last week of November, they staged a breakout from the Hajin pocket, attacking the American-allied Syrian Democratic Forces in the Syrian town of Gharanij, which those forces had captured a year earlier.

The breakout on Nov. 24 was a propaganda bonanza for the extremists, even though officials of the American-led coalition battling the Islamic State said they were quickly beaten back. Maj. Gen. Patrick Roberson, the American military commander, said the Islamic State took advantage of bad weather and sandstorms, when airstrikes were not possible.

“As we degrade their capabilities and push them into an ever smaller box, ISIS continues to employ more and more desperate measures,” General Roberson said. “These tactics won’t succeed.”