President Barack Obama isn’t running for office again this fall. But his final State of the Union address outlined his vision for national security for years to come and took shots at the military promises of his would-be Republican successors.

"Our foreign policy must be focused on the threat from ISIL and al-Qaida, but it can't stop there," he told members of Congress on Tuesday night, referring to the Islamic State group and its fellow terrorist organization responsible for the 9/11 attacks. "For even without ISIL, instability will continue for decades in many parts of the world .

"The world will look to us to help solve these problems, and our answer needs to be more than tough talk or calls to carpet bomb civilians. That may work as a TV sound bite, but it doesn't pass muster on the world stage."

In a speech billed as a focus on the country's future, Obama pushed back against accusations of allowing the military to shrink and the country to lose its status as a global leader.

The U.S. military budget, at around $600 billion annually, still dwarfs every other nation's, the president noted. "Our troops are the finest fighting force in the history of the world. No nation dares to attack us or our allies because they know that's the path to ruin."

America, he said, "is the most powerful nation on Earth. Period."

Obama drew audible grumbles from Republican lawmakers when he referenced "all the rhetoric you hear about our enemies getting stronger and America getting weaker."

Islamic State fighters, he said, pose a threat to Middle East stability but "do not threaten our national existence." America is not facing World War III, but instead "killers and fanatics who have to be rooted out, hunted down and destroyed."

Congressional Republicans have attacked the president for his lack of success in Iraq and Syria so far, but Obama insisted that U.S. military forces are making progress in their training and support roles overseas.

He blasted lawmakers for failing to pass a new authorization for use of military force against the Islamic State group, a criticism that has failed to produce progress on the issue for almost a year.

"The American people should know that, with or without Ccongressional action, ISIL will learn the same lessons as terrorists before them," the president said. "If you doubt America’s commitment,  or mine,  to see that justice is done, ask Osama bin Laden.

"It may take time, but we have long memories, and our reach has no limit."

WASHINGTON, DC - JANUARY 12: U.S. Secretary of Defense Ashton Carter greets members of congress before US President Barack Obama arrives to deliver the State of the Union speech before members of Congress in the House chamber of the U.S. Capitol January 12, 2016 in Washington, DC. In his last State of the Union, President Obama reflected on the past seven years in office and spoke on topics including climate change, gun control, immigration and income inequality. (Photo by Mark Wilson/Getty Images)
WASHINGTON, DC - JANUARY 12: U.S. Secretary of Defense Ashton Carter greets members of congress before US President Barack Obama arrives to deliver the State of the Union speech before members of Congress in the House chamber of the U.S. Capitol January 12, 2016 in Washington, DC. In his last State of the Union, President Obama reflected on the past seven years in office and spoke on topics including climate change, gun control, immigration and income inequality. (Photo by Mark Wilson/Getty Images)

Secretary of Defense Ash Carter greets members of the Joint Chiefs on Jan. 12 before President Barack Obama arrives to deliver the State of the Union in the House chamber of the US Capitol.

Photo Credit: Mark Wilson/Getty Images

Obama also listed al-Qaida as a continuing security threat to America but also global climate change, another issue that has rankled his political opponents. He also warned that "we also can't try to take over and rebuild every country that falls into crisis."

"That's not leadership; that's a recipe for quagmire, spilling American blood and treasure that ultimately weakens us. It's the lesson of Vietnam, of Iraq , and we should have learned it by now."

Instead, Obama argued, U.S. leaders need to embrace foreign partnerships and avoid demonizing Muslims worldwide, a direct criticism of several GOP candidates' campaign rhetoric — notably the business mogul Donald Trump.

WASHINGTON, DC - JANUARY 12: US President Barack Obama acknowledges members of Congress after delivering his State of the Union speech in the House chamber of the U.S. Capitol January 12, 2016 in Washington, DC. In his last State of the Union, President Obama reflected on the past seven years in office and spoke on topics including climate change, gun control, immigration and income inequality. (Photo by Chip Somodevilla/Getty Images)
WASHINGTON, DC - JANUARY 12: US President Barack Obama acknowledges members of Congress after delivering his State of the Union speech in the House chamber of the U.S. Capitol January 12, 2016 in Washington, DC. In his last State of the Union, President Obama reflected on the past seven years in office and spoke on topics including climate change, gun control, immigration and income inequality. (Photo by Chip Somodevilla/Getty Images)

President Obama acknowledges members of Congress on Jan. 12 after delivering his State of the Union speech in the House chamber of the U.S. Capitol. Members of the Joint Chiefs are seated in the front two rows.

Photo Credit: Chip Somodevilla/Getty Images

"American leadership in the 21st century is not a choice between ignoring the rest of the world , except when we kill terrorists, or occupying and rebuilding whatever society is unraveling," he said.

"Leadership means a wise application of military power, and rallying the world behind causes that are right. It means seeing our foreign assistance as part of our national security, not charity."

The speech did not offer any sweeping new military policies, and it drew immediate condemnation from several key Republican leaders for substituting hope for a strong security stance.

But Obama ended his speech on a hopeful note about reforming politics, one that drew decidedly one-sided applause from the congressional audience.

"As frustration grows, there will be voices urging us to fall back into tribes, to scapegoat fellow citizens who don't look like us, or pray like us, or vote like we do, or share the same background," he said.

"We can't afford to go down that path. It won't deliver the economy we want, or the security we want, but most of all, it contradicts everything that makes us the envy of the world."