President Obama delivered his last major speech on national security at MacDill Air Force Base in Florida on Tuesday, boasting that “no foreign terrorist organization has successfully planned and executed an attack” in the U.S.

“As you know all too well, your mission, and the course of history, was changed after the 9/11 attacks,” Obama told his military audience. “By the time I took office, the United States had been at war for seven years. For eight years that I’ve been in office, there has not been a day when a terrorist organization, or some radicalized individual, was not plotting to kill Americans. And on January 20th, I will become the first President of the United States to serve two full terms during a time of war.”

Obama said that during his presidency, the U.S. military has been “able to protect our homeland, to strike crippling blows against terrorist networks, and fortify our friends and our allies.”

He portrayed his policies in Iraq and Afghanistan as a complete success, while also slipping in a claim that withdrawing U.S. forces from Iraq was a decision forced upon him by the previous administration:

We brought nearly 150,000 troops home from Iraq, consistent with the Status of Forces Agreement negotiated by the previous administration, and we surged our efforts along with our allies in Afghanistan, which allowed us to focus on dismantling al-Qaeda, and give the Afghan government the opportunity to succeed. This focus on al-Qaeda, the most dangerous threat to the United States at the time, paid dividends. Today, by any measure, core al-Qaeda – the organization that hit us on 9/11 – is a shadow of its former self… I don’t want to paint too rosy of a picture, the situation in Afghanistan is still tough. War has been a part of life in Afghanistan for over 30 years, and the United States cannot eliminate the Taliban, or end violence in that country. But what we can do is deny al-Qaeda a safe haven, and what we can do is support Afghans who want a better future.

Obama said that even as al-Qaeda was “decimated” in Afghanistan and Pakistan, terror threats “metastasized” in other areas, “most dangerously” including the rise of the Islamic State, which he referred to as both ISIL and ISIS at various points. He said it was debatable whether a U.S. troop presence in Iraq could have prevented the invasion from the Islamic State, and he claimed it was not an option in any event. He also blamed the “sectarian” government in Baghdad and “brutal dictator” in Syria for empowering the Islamic State.

He applauded the “relentless, sustainable, multilateral” campaign waged against ISIS since the United States’s return to Iraq, citing its low cost compared to the Iraq War. Obama said these efforts have dramatically improved U.S. domestic security. “No foreign terrorist organization has successfully planned and executed an attack on our homeland,” he said. “And it’s not because they didn’t try. Plots have been disrupted, terrorists have been taken off the battlefield. And we’ve done this even as we drew down nearly 180,000 troops in harm’s way, in Iraq and Afghanistan.”

However, he allowed that “in some form, this violent extremism will be with us for years to come,” citing a “breakdown of order” in the Middle East that has “unleashed forces that are going to take a generation to resolve.”

He named “a change in climate” as one of these forces because it is “increasing competition for food and water.” Also, Obama said, “false prophets are peddling a vision of Islam that is irreconcilable with tolerance and modernity and basic science.”

The President then admitted there have been “deadly attacks on the homeland” during his tenure, but they “have not been carried out by operatives with sophisticated networks or equipment, directed from abroad.” Rather, they have been carried out by “homegrown and largely isolated individuals who were radicalized online.”

“These deranged killers can’t inflict the sort of mass casualties that we saw on 9/11, but the pain of those who lost loved ones in Boston, and San Bernardino, and Fort Hood, and Orlando, that pain continues to this day,” Obama said. “And in some cases, it has stirred fear in our populations, and threatens to change how we think about ourselves and our lives.” He continued:

Somebody who’s trying to kill, and willing to be killed, is dangerous particularly when we live in a country where it’s very easy for that person to buy a very powerful weapon. So rather than offer false promises that we can eliminate terror by dropping more bombs, or deploying more and more troops, or fencing ourselves off from the rest of the world, we have to take a long view of the terrorist threat, and we have to pursue a smart strategy that can be sustained.

He recommended keeping the terrorist threat “in perspective” by treating them as “thugs and murderers,” rather than the “vanguard of a new world order” they posture as.

“Today’s terrorists can kill innocent people, but they don’t pose an existential threat to our nation, and we must not make the mistake of elevating them as if they do,” Obama said. “That does their job for them. It makes them more important, and helps them with recruitment.”

“These terrorists can never directly destroy our way of life,” he insisted. “But we can do it for them, if we lose track of who we are, and the values that this nation was founded upon.”

Watch Obama’s full remarks here.

