Pablo Martinez Monsivais / AP

A day ago, U.S.-backed Iraqi forces seized one of the Islamic State’s operations centers on the outskirts of Ramadi, the Iraqi city that has been under the group’s control since spring.

The recapture was a significant achievement in the battle to wrest neighborhoods in and around Ramadi from the Islamic State’s grasp. But it took “a frustratingly long time” to get to this point, U.S. Defense Secretary Ash Carter said Wednesday.

Carter said that though there has been some success in the attempt to retake Ramadi in recent months, “there is still tough fighting ahead.” And, he said, the Pentagon is prepared to deploy advisers and attack helicopters—if the prime minister of Iraq wants them—to the region to “finish the job.”

“I mention all this because it represents how we’ve adapted in the way we support our Iraqi partners. And it shows that training, advising, and assisting is the right approach,” Carter said at a Senate Armed Services Committee hearing. “We will do more of what works going forward.”

The Obama administration has repeatedly said it would not put “boots on the ground” in Iraq, where the Islamic State controls large swaths of territory, or in Syria, where the group has established its capital in Raqqa. Since last summer, the United States has been conducting airstrikes against Islamic State targets in Iraq and Syria; in Iraq, it has supported ground offensives by local fighters.

But the second half of this year has seen a public escalation in the administration’s response to the group—one that involves more Americans—but not quite “boots”—on the ground. In June, President Obama authorized the deployment of 450 U.S. troops to Iraq to advise government forces. In November, Pentagon announced it would send special-operations troops to help U.S.-backed rebels in Syria for the first time; the team of about 50, officials said, would advise vetted Syrian and Kurdish rebel groups, and not take part in ground combat. And last week, Carter said the U.S. will send special-operations troops to Iraq that, “over time,” will conduct raids, free hostages, gather intelligence, and attempt to capture Islamic State leaders.

Those steps come amid high-profile operations claimed by the Islamic State, like last month’s deadly attacks in Paris in Beirut, and apparently inspired by it, like last week’s shooting rampage in San Bernardino, California. Those assaults, and the president’s response to them, have been sharply criticized by lawmakers—and the American public—as insufficient and ineffective.

Senator John McCain, chairman of the Senate Armed Services Committee, asked Carter on Wednesday whether the defense secretary agreed with a recent comment made by Marine General Joseph Dunford, chairman of the Joint Chiefs of State, that “we have not contained” the Islamic State.

“I agree with what General Dunford said, yes,” Carter replied.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.