The Pentagon's two top leaders said Wednesday that the U.S. military will keep forces deployed to the Middle East long after the defeat of the Islamic State group in Iraq and Syria.

"What is obvious and very clear is that we're going to be in that region for a while," Defense Secretary Ash Carter said Wednesday at the Pentagon during a "troop talk" that was streamed live on social media.

Carter's comments came in response to a question from a soldier in Baghdad, Staff Sgt. Rory Radtke, who asked about the future of U.S. forces in Iraq and the Middle East.

"You bet. We'll be in your region even after ISIL's defeated," Carter said. ISIS and ISIL are acronyms for the Islamic State group.

Also on Wednesday, Chairman of the Joint Chiefs of Staff Gen. Joseph Dunford said U.S. forces will be in the region, possibly Iraq, for a long time. 

Dunford said the Pentagon should consider how to develop a more permanent command-and-control structure for operations in the region.

"If you assume, like I do, that we're going to be in that region, if not in Iraq, for many, many years to come, then we do need to open the aperture in terms of how we source these headquarters and the talent from which we draw to command," Dunford  told an audience at an Air Force Association conference. 

Carter stopped short of saying troops will remain in Iraq, where the U.S. has nearly 5,000 personnel deployed.

Carter and other top military officials are increasingly confident that defeating the Islamic State group in Iraq and Syria is inevitable, clearing the way for new questions about who will govern those areas afterward and what the U.S. military role might be.

"Damn right, ISIL is going to be defeated," Carter said.

"So what comes after that?"

He told the soldier in Baghdad that the limited nature of the strategy in Iraq is vital to the long-term stability.

"Working with the Iraqi forces, which can be frustrating," Carter said, "it’s the only way to do it, because it’s the only way to make victory stick. We can't run these places, we can’t govern these places."

"It’s important that the people who live there regain their countries and govern them a in a way that doesn’t let radicals get back in," Carter said.

He said the U.S. has many concerns in the Middle East beyond ISIL

"ISIL is a big problem, but one we're going to take care of through defeat. But we have Iran over there, we have other issues in the Middle East.