ABOARD THE U.S.S. NIMITZ, in the Persian Gulf — A few days ago, Capt. Mike Spencer of the Navy rocketed off the flight deck of an aircraft carrier in his F-18 to provide air support for Iraqi troops advancing on the dusty city of Tal Afar, one of the Islamic State’s last strongholds.

A busy six hours followed in the skies over Iraq. As Islamic State fighters fired on Iraqi forces from a building, Captain Spencer dropped precision-guided munitions on them, destroying the structure and presumably killing the men inside. A short while later, he was ordered to take out another Islamic State fighting position nearby. He did so, and then eliminated another.

When he ran out of bombs, Captain Spencer headed back to his carrier.

The Risk board that is the map of Iraq may show almost certain defeat for the Islamic State as its territory continues to shrink, but American officials say the pace of the fight is not slowing. The aircraft carrier Nimitz, where Captain Spencer commands a Navy squadron, is launching as many sorties and strikes against Islamic State targets in Iraq and Syria as other American aircraft carriers were doing three years ago, after President Barack Obama opened the bombing campaign.

The militants have lost a long list of cities and towns in Iraq — Baquba, Abu Ghraib, Falluja, Ramadi, Tikrit, Mosul and, now, Tal Afar, which the Iraqi prime minister declared liberated on Thursday — and are under attack from all sides in a desperate fight over Raqqa, their self-proclaimed capital in Syria. But one would never know it from the way the extremists have continued to fight, American soldiers and airmen say.