The speech was an explicit return to a theme that Mr. Obama has played down in the wake of terrorist attacks that killed 130 people on Nov. 13 in Paris and 14 more on Dec. 2 in San Bernardino, Calif., both of which were inspired by Islamic extremism. While Mr. Obama’s initial response to the San Bernardino attack emphasized its commonality with other mass shootings and the need for gun restrictions, the administration soon realized that this message was failing to reassure Americans that he was taking seriously enough the threat from Islamic extremism and the Islamic State.

So through much of December, Mr. Obama engaged in public events to convince Americans that his administration was doing everything it could to battle the Islamic State. For some Americans, being vigilant against Islamic extremism involves having more guns, not fewer, and sales of guns surged in the wake of the San Bernardino attack.

The administration sees such a response as counterproductive not only because the number of deaths from gun suicides and routine shootings is far greater than those from terrorist attacks, but also because the availability of weapons here makes such attacks far easier to conduct. Rather than fight both the anxiety about Islamic extremism and the need for more gun restrictions at the same time, Mr. Obama focused on calming the nation.

Now, a month after the San Bernardino attacks, Mr. Obama has decided that he can return to his focus on gun measures. “Because I get too many letters from parents, and teachers, and kids, to sit around and do nothing,” Mr. Obama said in his speech Friday.

A bipartisan effort in 2013 to bolster gun control measures after the Newtown shootings was halted in the Senate, failing to garner the 60 votes needed to expand background checks and to ban assault weapons and high-capacity magazines.