Defense Secretary Jim Mattis and Joint Chiefs Chairman Gen. Joseph Dunford both told Congress Wednesday that a residual force of U.S. troops should remain in Iraq after the Islamic State is defeated to prevent a resurgence of the terrorist group. That's in line with what Secretary of State Rex Tillerson said Wednesday at a meeting of the coalition to defeat the Islamic State in Washington.

Testifying before a Senate Appropriations subcommittee, Mattis said it would be a mistake to declare victory and leave, as the U.S. did in 2011.

"I don't see any reason to pull out again, and find the same lesson," he said.

Many analysts blame the Obama administration for failing to negotiate an agreement with the government of former Iraq Prime Minister Nouri al-Malaki to keep U.S. troops in an advisory role, a failure they argue led to the rise of the Islamic State.

"I believe it's in our national interest that we keep the Iraqi Security Forces in a position to keep our enemies on their back foot, our mutual enemies on their back foot," Mattis testified.

Mattis was responding to a question from Sen. Lindsey Graham, R-S.C., who asked both men if they would support a residual force staying in Iraq to make sure that the Islamic State doesn't come back, assuming the Iraqis would accept one.

"I agree with that, Sen. Graham. I believe that the Iraqi Security Forces clearly are gonna need that kind of support for some time to come," Dunford said. "We need to remain decisively engaged in Iraq and in the region."

Graham said he had been told by current Prime Minister Haider al-Abadi, who is in Washington for the meeting of the 68 nations in the counter-Islamic State coalition, that the reconstruction of Anbar province and Mosul will run about $50 billion.

"Do you agree, just as important to having troops there as a residual force, we should probably come up with a game plan to reconstruct Iraq so that we'd have leverage in Baghdad?" Graham asked. "Not just troops, but an assistance plan for the Iraqis?"

Dunford replied that would be a topic of discussion at the counter-Islamic State summit at the State Department, hosted by Tillerson.

"It's going to be an international effort," Mattis said. "It should not be carried fully by the U.S. taxpayer."