Updated

Iraqi special forces swept into Fallujah on Friday, recapturing most of the city as the Islamic State terror group's grip crumbled after weeks of fighting.

Thousands of trapped residents took advantage of the militants' retreat to flee, some swimming across the Euphrates River to safety.

fallujah fight 617

Iraqi security forces advance their positions during heavy fighting against Islamic State group militants in Fallujah on Tuesday. (AP Photo/Anmar Khalil)

Defense Secretary Ash Carter said it was "too early" to say with certainty that Iraqi forces controlled all of the city. "There's still some fighting to be done."

Carter said the U.S. military supported the Iraqi forces with advise and air support.

As many as 42,000 people have left Fallujah since the military operation against Fallujah began in late May, according to the United Nations. The Iraqi operation to retake Ramadi left that city largely in ruins. The city once was home to nearly half a million people, but the violence forced most of them to flee.

Fox News asked Carter about CIA Director John Brennan's testimony Thursday saying the terror capacity of ISIS had not been diminished despite some 13,000 airstrikes, bringing into question the strategy against the group. Carter said the strategy against ISIS had "three parts to it" and defeating ISIS in Iraq and Syria was "necessary but not sufficient."

He added, "There are other places around the world to which ISIL has spread and then we have to protect our own homeland as well."

The terror network has held Fallujah longer than any other city, capturing it in January 2014.

Despite the focus on control of Fallujah, 40 miles west of Baghdad, U.S. military officials have said they want the Iraqi forces to continue plans to recapture Mosul, where the majority of ISIS fighters in Iraq are located.

Iraq's prime minister Haider al-Abadi's office tweeted that he was discussing the Mosul operation Friday with Gen. Joseph Votel, commander of U.S. Central Command.

Residents described harrowing escapes even after ISIS fighters abandoned some checkpoints that had them bottled up in the city. On the river, some boats packed with people overturned in the water. Others picked their way down roads laced with hidden bombs that killed several. In some cases, ISIS allowed people to leave only if they took the jihadis' families with them.

After weeks of heavy battles since the offensive began in late May, it appeared that ISIS defenses in much of the city collapsed abruptly.

In the early morning Friday, Iraqi forces punched into the city center, meeting intense fighting. But by evening, the special forces commander Brig. Haider al-Obedi told the Associated Press that his troops controlled 80 percent of the city, with ISIS fighters now concentrated in four districts on its northern edge.

It was a major step toward regaining the Islamic State group's last major foothold in Iraq's western Anbar province, the heartland of the country's Sunni minority. It was the first urban area to fall into ISIS hands before it overran most of Anbar and much of northern Iraq.

Fox News' Lucas Tomlinson and The Associated Press contributed to this report.