In his weekly press conference, Iraqi Prime Minister Haider al-Abadi described Tuesday's progress as "excellent", calling it an "indication of the enemy's collapse".
The jihadists had not been able "to stand up to our team in combat, and they have not retaken one inch of ground that they lost", he said.
Mattis was in Iraq as part of a five-day overseas trip to the Middle East and Europe to enhance strategic partnerships, discuss the campaign to defeat ISIS and bolster the US commitment to North Atlantic Treaty Organisation partnerships.
"The fighting is tough", Townsend said, "but the momentum is with our partners".
Earlier, Mr. Mattis described the extremists as being trapped in a "military vise" that will squeeze them on both sides of the Syria-Iraq border.
Mattis arrived in the Iraqi capital on Tuesday morning for an unannounced visit.
The fall of Mosul effectively marked the end of the self-proclaimed caliphate Islamic State declared over parts of Syria and Iraq in 2014.
But Heras said Mattis, whom he said has earned firm trust among Iraqis, needs to help Abadi further build his base as a moderate for the post-war period, with elections looming for next year.
Right before departing for Iraq, the Pentagon chief alleged that "ISIS (Daesh)'s days are certainly numbered, but it's not over yet and it's not going to be over any time soon".
The defense secretary commended efforts from USA, coalition and Iraqi forces, lauding the positive gains since Iraqi Prime Minister Haider al-Abadi took office in 2014.
The ranking U.S. Air Force officer in Iraq, Brig.
"It appears more fractured, less robust, and sort of flimsy, is the word I would use", Croft said.
"It's less coordinated than it was before", he said. US -allied forces are now battling IS in the Syrian city of Raqqa, the extremists' de facto capital.
In Syria, the terrorists are surrounded and cut off, but continue to show their cruelty as they hide among women and children and show no regard for noncombatants, according to Townsend.
Although the Taliban are the main opposition forces in Afghanistan, an Islamic State affiliate has emerged there, too.
An immediate worry is a Kurdish independence referendum to be held September 25.
In Iraq, Mattis was due to meet with senior Iraqi government leaders and United States commanders.
The attack comes three days after Iraqi forces announced the military operation to liberate Tal Afar from IS. "The liberation of Raqqa was not even that", the general said.