President Obama had a few good points to make in his valedictory counter-terrorism speech, delivered at MacDill Air Force Base in Florida on Tuesday. This passage, near the end, resonated in particular: “If we stigmatize good, patriotic Muslims, that just feeds the terrorists’ narrative. It fuels the same false grievances that they use to motivate people to kill. If we act like this is a war between the United States and Islam, we’re not just going to lose more Americans to terrorist attacks, but we’ll also lose sight of the very principles we claim to defend.” Donald Trump wasn’t named but, obviously, this was a warning from the incumbent president to his successor about how not to fight terrorism.

Obama’s message would have had more credibility, however, if he had engaged in any of the reflection or self-questioning on which he prides himself. He did not. Instead, he sacrificed believability from the beginning by turning the speech into one long apologia for his approach to fighting terrorism. If Obama had made any mistakes—such as leaving Libya, Syria, Yemen and Iraq in chaos—you wouldn’t know it from his presentation. You would certainly have no hint that the terrorism problem has gotten far worse under his watch. Recall that when he came into office Islamic State and the Syrian Conquest Front (al-Qaeda’s official Syrian affiliate) did not exist, Iran’s proxy militias did not have free run of Iraq or Syria, and America had not suffered the terrible terrorist attacks at Fort Hood, San Bernardino, the Boston marathon, or Orlando.

Instead of acknowledging these well-known facts, or grappling with his own responsibility for this state of affairs, Obama hit the rewind button on his Golden Oldies. He bragged, for instance, that “we brought nearly 150,000 troops home from Iraq,” while denying that their removal had anything to do with the rise of Islamic State. “Maintaining American troops in Iraq at the time,” he claimed, “could not have reversed the forces that contributed to ISIL’s rise—a government in Baghdad that pursued a sectarian agenda, a brutal dictator in Syria who lost control of large parts of the country, social media that reached a global pool of recruits, and a hollowing out of Iraq’s security forces, which were ultimately overrun in Mosul in 2014.”

Keeping U.S. troops in Iraq—and doing more to help the moderate Syrian rebels–could have ameliorated or even stopped all of these trends. Even if Islamic State had still arisen, the Iraqi security forces would have been more likely to battle it effectively if they had been buttressed by U.S. advisers. But for the president, that’s an inconvenient truth best denied.

So, too, did Obama refuse to acknowledge the parlous consequences of his rapid drawdown in Afghanistan. He built up U.S. forces to 100,000 personnel by 2011 and now has drawn them down to just 8,400. The result is that Afghan security forces are suffering the worst casualties during the entire war and the Taliban are stronger than at any point since Obama took office. General Joe Votel, head of Central Command, just admitted that the government only controls 60 percent of the country, with the Taliban in control of 10 percent and the rest disputed territory.

Those statistics are undoubtedly shaded toward the optimistic side. Even so, they are not terribly encouraging. Imagine if 40 percent of the United States were outside the firm control of the government—that would be a sign of a national catastrophe akin to our Civil War, not a sign of good civic health as President Obama made it out to be.

He neatly elided the dismaying security situation on the ground by focusing on inputs rather than outputs: “What we can do is support Afghans who want a better future, which is why we have worked not only with their military, but we’ve backed a unity government in Kabul. We’ve helped Afghan girls go to school. We’ve supported investments in health care and electricity and education. You have made a difference in Afghanistan, and America is safer for it.” All that is true, but it doesn’t reckon with the real state of the war on the ground.

Obama was just as slippery in claiming credit for domestic security: “No foreign terrorist organization has successfully planned and executed an attack on our homeland,” he said. That’s true, I suppose, if you are talking strictly about a 9/11-type operation planned from abroad and executed by imported killers. But even if the San Bernardino, Fort Hood or Orlando killers weren’t acting on orders from foreign terrorist organizations, they were certainly inspired by them, and in particular by Islamic State and al-Qaeda in the Arabian Peninsula (AQAP). Major Nidal Hasan was in repeated contact with AQAP’s Anwar al-Awlaki before his shooting rampage which left 13 dead at Fort Hood. Foreign terrorist groups have learned that they can circumvent a lot of our border security by radicalizing people who are already here.

Obama knows all this, and yet he refuses to acknowledge it even as he goes out of office. He gives little evidence that he has learned much during his tenure; instead, he continues to cling to the same certitudes that have guided his policy no matter how often they have been at odds with reality. In failing to adjust his a priori ideological convictions to the demands of the real world, he is setting the worst possible example for his successor.