President Obama mismanaged two wars, oversaw the collapse of order across the Middle East, and left the United States and the world less safe.

This month President Barack Obama gave a valedictory on his foreign policy at MacDill Air Force Base in Florida. It was a perfect synopsis of the myths he wove to justify his foreign policy legacy—a legacy that urgently needs demythologizing. Obama mismanaged two wars, oversaw the collapse of order across the Middle East, and left the United States and the world less safe.

To obscure this reality, Obama’s speech was replete with distortions, oversights, and exaggerations. Here are a few.

1. He Mismanaged the War in Afghanistan

“I believe that the United States military can achieve any mission,” Obama said last week, just a few paragraphs before saying “the United States cannot eliminate the Taliban or end violence in that country,” oblivious to the contradiction. If we can achieve any mission, surely we can defeat a two-bit insurgency.

Obama (and a good portion of columnists and talking heads) have consistently exaggerated the difficulties in Afghanistan to excuse America’s failures there: you can’t blame us if the mission was impossible from the start. Obama said, “War has been a part of life in Afghanistan for over 30 years,” implying it is some sort of natural phenomenon genetically and geographically ingrained in the Afghan people and invincible to the efforts of any human to change.

Whether this is ethnic essentialism or historical determinism, it is a condescending and shallow way to assess the challenges Afghanistan faces, and a dishonest way to excuse lackluster leadership in America’s longest war. Before pessimism about Afghanistan became chic, Senator Obama, then campaigning for president, sounded a much more optimistic and, frankly, presidential note. In July 2008 he said of the war in Afghanistan, “I will make the fight against al Qaeda and the Taliban the top priority that it should be. This is a war that we have to win.”

Eight years later, The New York Times headlined a story: “Afghan Security Crisis Sets Stage for Terrorists’ Resurgence.” As I have written about extensively elsewhere, Obama’s failure in Afghanistan is a scandal of historic proportions and a major part of the legacy he leaves the world.

2. His Approach to Stability Operations Was Strategically Incoherent

Obama failed in Afghanistan (and Iraq) partly because of a strategic incoherence and a failure to understand the ultimate conditions of victory: stability in the societies that gave rise to jihadism.

In his MacDill speech Obama said, “I have also insisted that it is unwise and unsustainable to ask our military to build nations on the other side of the world, or resolve their internal conflicts,” echoing an increasingly fashionable critique of stability operations.

Obama is speaking from the same script that most politicians have been for the past five years. Everyone from Ted Cruz and Rand Paul to Donald Trump have given voice to the obligatory damnation of “nation building” since the withdrawal of U.S. troops from in Iraq in 2011. The only problem is that this is completely wrongheaded and strategically counterproductive. Someone put the counterargument extremely well:

Any long-term strategy to reduce the threat of terrorism depends on investments that strengthen some of these fragile societies. Our generals, our commanders understand this. This is not charity. It’s fundamental to our national security. A dollar spent on development is worth a lot more than a dollar spent fighting a war… Our military recognizes that these issues of governance and human dignity and development are vital to our security. It’s central to our plans in places like Afghanistan and Iraq.

Who said this? Surprisingly, it was Obama, in the exact same speech where he said we would not “build nations on the other side of the world.” So which is right? Should be avoid “building nations,” or should we make “investments that strengthen fragile societies” to improve “governance and human dignity”?

Obama was apparently completely unaware of the flagrant contradictions in his rhetoric, a contradiction that suggests an incoherence of strategic thought in his administration. I happen to think he was right to defend the importance of stability operations and wrong to condemn nation-building.

But when it came time to make decisions about budgets and deployments, there was no contradiction. Obama’s Defense Department said back in 2012—when Obama was on the second of his four secretaries of Defense—that “U.S. forces will no longer be sized to conduct large-scale, prolonged stability operations.”

Foreign aid declined from $3.5 billion in 2009 to $2 billion in 2015. Obama eliminated funding for the State Department’s Bureau of Conflict and Stabilization Operations. And, despite Obama’s glowing account of how “We’ve helped Afghan girls go to school. We’ve supported investments in health care and electricity and education,” his administration actually cut civilian assistance to Afghanistan every year since 2010.

By his own logic, Obama underinvested in the long-term strategy necessary to achieve sustainable security and undermine the appeal of jihadism. Maybe that is why both Iraq and Afghanistan are worse off now than they were eight years ago, still in the throes of political violence, state weakness, corruption, and sectarianism.

3. He Contributed to the Collapse of Iraq and the Rise of ISIS

But Afghanistan practically looks like a success next to the unfolding apocalypse in the heart of the Middle East. Here is where Obama went for broke: the central myth of the Obama foreign policy legacy is that the rise of ISIS is Bush’s fault; that the planned withdrawal of U.S. troops from Iraq in 2011 was irrevocable; and that the withdrawal contributed nothing to ISIS’s rise.

Obama said in his speech: “There’s been a debate about ISIL that’s focused on whether a continued U.S. troop presence in Iraq back in 2011 could have stopped the threat of ISIL from growing.” He claimed it was impossible not to withdrawal from Iraq: “And as a practical matter, this was not an option. By 2011, Iraqis wanted our military presence to end, and they were unwilling to sign a new Status of Forces Agreement.”

This is simply false. Even the Obama administration wanted to negotiate some sort of stay-behind force of perhaps 10,000 troops in Iraq after 2011. There were active negotiations throughout 2011 to extend the Status of Forces Agreement. But the Obama administration was unwilling to spend political capital on an unpopular deployment that the president had campaigned against, so when negotiations got difficult he walked away.

But in Obama’s narrative, the withdrawal didn’t hurt Iraq or contribute to the collapse of order and the rise of ISIS over the next few years. “Maintaining American troops in Iraq at the time [2011] could not have reversed the forces that contributed to ISIL’s rise,” Obama said in his speech. Again, keep in mind that the U.S. military can “achieve any mission,”—just not, apparently, ones that Obama finds politically difficult to undertake.

No, according to Obama, a residual presence of U.S. troops could have done nothing to bolster Iraq’s security forces; keep al-Qaida in Iraq on the run; prevent their regrouping and rebranding as the Islamic State; stop them from seizing Fallujah in January 2014 or Mosul in June of the same year; or stop their campaign of genocidal violence against Christians, Yazidis, Shia, and Kurds.

But if U.S. troops could not have done anything in 2011, why has Obama ordered U.S. troops back to Iraq to fight ISIS now? What does Obama think U.S. troops can achieve today that they apparently could not have achieved at considerably less cost with an already existing deployment back in 2011? Obviously our troops can make a difference, and Obama knows it, or he would not have ordered them back to Iraq in 2014.

If Bush’s invasion is to blame for the rise of ISIS, Obama’s withdrawal is even more directly culpable.

But, for that matter, where does Obama think ISIS came from? Here, Obama’s mendacity comes fully to the fore. Explaining his decision to order airstrikes in 2014, Obama explained, “In shaping our response, we refused to repeat some of the mistakes of the 2003 invasion that have helped to give rise to the organization that became ISIL in the first place.” In other words: The invasion of Iraq and bungled occupation set off a chain of events that eventually led, down the line, to the conditions that enabled the rise of ISIS: ergo, blame Bush, not me.

This convenient narrative omits the fact that Obama, not Bush, was in charge and calling the shots during the final few links in that chain of events, the events most proximately involved in the actual rise of ISIS. If Obama is going to use the logic that U.S. actions inadvertently laid the groundwork that ISIS exploited, he should at least be honest about his own role. If Bush’s invasion is to blame for the rise of ISIS, Obama’s withdrawal is even more directly culpable.

Obama’s attempt to shift blame hinges on a blatant double standard: when bad history happens under Bush’s watch, blame Bush. When bad history happens under Obama watch, it can’t be helped and didn’t really hurt anything anyway.

Obama always said the United States should withdraw from Iraq as responsibly as it got into it irresponsibly. On that score, he utterly failed. No U.S. policymaker wanted to enable the rise of a global terrorist army, but here we are. There’s blame enough for everyone.

4. He Declared Mission Accomplished

After all these errors and missteps, Obama nonetheless declared victory in America’s war against jihadists. He said in his speech, “Today, by any measure, core al Qaeda — the organization that hit us on 9/11 — is a shadow of its former self… Its leadership has been decimated. Dozens of terrorist leaders have been killed.”

As for ISIS, it “has lost more than half its territory. ISIL has lost control of major population centers. Its morale is plummeting. Its recruitment is drying up.” He also claimed that “no foreign terrorist organization has successfully planned and executed an attack on our homeland” during his presidency.

By every measure, jihadist groups are more popular, more widespread, and more powerful now than in 2009.

Obama is aiming at goalposts best calculated to ensure he’s already in the end zone. He needs to claim as many touchdowns as possible, so he’s shifting the definition of victory to meet his political needs regardless of strategic considerations. But his criteria of success are largely irrelevant to American security.

Does anyone believe that the decimation of “core al-Qaeda” is a relevant way to measure success when a dozen other jihadist franchises have cropped up in recent years? Does the acreage of land under ISIS control really matter when they can inspire a couple of lunatics to murder 130 civilians in Paris? Does it matter if jihadists are technically “foreign” if they are still able to carry out attacks on the homeland, as they did in Boston, Orlando, Fort Hood, and San Bernardino? Is Obama aware that counting up the number of dead terrorists as a measure of success is startlingly similar to the military’s infamous, and misleading, body counts of dead Vietnamese?

According to a RAND Corporation report, the number of jihadist groups increased by 58 percent since 2010, the number of fighters more than doubled in the same time frame, and attacks increased nearly tenfold since 2008. By every measure, jihadist groups are more popular, more widespread, and more powerful now than in 2009. Because of the collapse of order in Iraq, Syria, Afghanistan, Yemen, and elsewhere, they have more safe haven and better recruiting grounds. This is not what victory in the war against jihadism looks like.

Obama first declared victory in 2011, when he said the “tide of war is receding.” This comforting analogy suggests war is like the tides: an impersonal force of nature beyond human control. Since the tide is going out, we can safely ignore it without fear of repercussions. The metaphor is wrong and deceptive. War is a human activity and thus responds to human decisions. As Trotsky famously said “You may not be interested in war, but war may be interested in you.”

That serves nicely as the epitaph of the Obama presidency. Obama was plainly not interested in war, but jihadists around the world remained interested in attacking the United States, regardless of what the American president believed about tides, or terrorism, or much else.