WASHINGTON — President Obama’s top military adviser said Tuesday that he would recommend deploying United States forces in ground operations against Islamic extremists in Iraq if airstrikes proved insufficient, opening the door to a riskier, more expansive American combat role than the president has publicly outlined.

Gen. Martin E. Dempsey, the chairman of the Joint Chiefs of Staff, told the Senate Armed Services Committee that while he was confident that an American-led coalition would defeat the Islamic State, he would not foreclose the possibility of asking Mr. Obama to send American troops to fight the militants on the ground — something Mr. Obama has ruled out.

“My view at this point is that this coalition is the appropriate way forward. I believe that will prove true,” General Dempsey said. “But if it fails to be true, and if there are threats to the United States, then I, of course, would go back to the president and make a recommendation that may include the use of U.S. military ground forces.”

General Dempsey acknowledged that this would run counter to the president’s policy, but he said, “He has told me as well to come back to him on a case-by-case basis.”