TAMPA, Fla. — President Obama on Wednesday repeated his vow to destroy Islamist terrorists in Syria and Iraq, but he insisted that the United States would not go it alone and promised a military audience that he would not send them back into direct combat.

“Whether in Iraq or in Syria, these terrorists will learn the same thing that the leaders of Al Qaeda already know: We mean what we say,” Mr. Obama said at MacDill Air Force Base. “We’ve always known that the end of the war in Afghanistan didn’t mean the end of threats or challenges to America.”

But Mr. Obama also hailed the official end of America’s combat mission in Afghanistan at the end of the year and said he was not starting another extensive war in the Middle East. He said the American troops currently in Iraq — they will soon number 1,600 — were not there to fight on the ground.