The president has relied since the summer of 2014 on a combination of airstrikes, financial sanctions and targeted special operations to counter the growth of the Islamic State, while building a diplomatic coalition of dozens of nations and resisting any call for the reintroduction of large numbers of American ground troops.

But despite thousands of airstrikes since then, the Islamic State militants continue to occupy large areas of land in the region. A sophisticated social media campaign by the terror network has succeeded in helping recruit believers across the globe, including, officials say, in the United States.

After announcing that he would deliver Sunday’s address, Mr. Obama had initially decided to cancel his previously scheduled appearance at the Kennedy Center Honors event, which honors pioneers in the arts, on Sunday evening. But a few hours before the speech, White House officials said he had reconsidered and would be going after all.

In an effort to limit gun sales in the United States, Mr. Obama’s staff is working on a proposal that would expand the definition of a “high-volume gun dealer” so more purchases would be subject to background checks. But aides say that proposal would face legal, practical and political challenges. An announcement is said to be at least a month away.

Once it became clear that the attack in Southern California seemed different from other mass shootings — with a connection to international terrorism and a jihadist element — a presidential response that seemed limited to domestic concerns may have seemed insufficient to his advisers. But Sunday’s speech offered political danger, as well, for a president who was elected on a promise to disentangle the United States from long military conflicts in the Middle East. Any promise to the American people to destroy the Islamic State carries with it the risk of a new and unpopular war.

“We all want the president to do more and all feel he should do more, but the nasty truth is that doing more will further embed us in that region,” said Rick Nelson, a former counterterrorism official in the administration of President George W. Bush.