Peter Bergen is CNN's national security analyst, a vice president at New America and a professor of practice at Arizona State University. His new book, "Trump and His Generals: The Cost of Chaos," will be published in December. The opinions expressed in this commentary are his own. View more opinion articles at CNN.

(CNN) President Donald Trump can certainly take a victory lap for the operation that killed the leader of ISIS, Abu Bakr al-Baghdadi. Prior to his death, Baghdadi had declared ISIS a "caliphate," as his terrorist army stormed across Syria and Iraq, seizing territory the size of Portugal and ruling over some 8 million subjects.

At Trump's Sunday news conference, he said the ISIS leader was also personally responsible for the death of American aid worker Kayla Mueller . This appears to be the first official US acknowledgment of Baghdadi's role in her death, as ISIS had claimed that she had died in a Jordanian airstrike in 2015. White House national security adviser Robert O'Brien told NBC the operation that killed Baghdadi was named after Mueller.

Not surprisingly, many are praising Trump's success. Gen. Joseph Votel, who led the war against ISIS for three years under Presidents Barack Obama and Trump, and retired in March, emailed me to say, "By any measure this was an important milestone -- not just for the campaign but for everyone who was victimized by ISIS under Baghdadi's leadership. It is a psychological blow to ISIS, and it demonstrates the effort we will go to bring these terrorists to justice."

In fact, Trump's campaign against ISIS is one of the unalloyed foreign policy successes of his presidency. A week after he was inaugurated, Trump issued National Security Presidential Memorandum 3 , which mandated an updated campaign plan against ISIS within 30 days.

And, in May 2017, Trump approved a plan to arm the tens of thousands of Kurdish forces fighting ISIS in Syria with rifles, machine guns and lightweight mortars. The Trump plan also lifted Obama-era caps on the size of the US military presence in Syria. During Trump's first year in office, American forces in Syria would rise to 2,000 troops

JUST WATCHED Esper details 'flawless' al-Baghdadi raid Replay More Videos ... MUST WATCH Esper details 'flawless' al-Baghdadi raid 11:41

But the campaign to eradicate ISIS began two and a half years before Trump assumed office, when Obama ordered ISIS positions to be bombed during the late summer of 2014. The operation to take back Mosul, the second-largest city in Iraq where ISIS had first declared its caliphate, began in October 2016 while Obama was still in office. ISIS had also lost significant Iraqi cities , such as Fallujah, Ramadi and Tikrit, while Obama was commander in chief.

So there was certainly considerable continuity between the Obama plan against ISIS and the Trump plan, but Trump did give his military commanders the authority for taking action against ISIS so they were no longer micromanaged by the White House, as was often the case under Obama. Also, the Trump administration did away with the self-imposed limits the Obama team had put on military action in Syria.

While Trump can certainly take credit for hastening the demise of ISIS's geographical caliphate, ultimately both presidents approached the ISIS problem in the same essential way.

First, they didn't commit large numbers of American boots on the ground in either Iraq or Syria.

Second, using US Special Forces as trainers and advisers, they operated " by, with and through " local forces. In Iraq, those forces were the Counter-Terrorism Service and its elite Golden Division, while in Syria it was the largely Kurdish fighters of the Syrian Democratic Forces (SDF).

American fighters and helicopters provided significant air support to both of these local ground forces.

ISIS once attracted an estimated 40,000 militants from around the world. The Obama and Trump campaigns against ISIS pushed that number closer to zero, since few now want to join the losing team.

The geographical defeat of ISIS in Iraq and Syria did not end the influence of ISIS, however. In a January report to Congress, the then-director of national intelligence, Dan Coats, wrote that "ISIS still commands thousands of fighters in Iraq and Syria, and it maintains eight branches, more than a dozen networks, and thousands of dispersed supporters around the world, despite significant leadership and territorial losses."

Three months after Coats' report was published, a Sri Lankan jihadist group inspired by ISIS carried out multiple suicide bombings across the country in churches packed with worshippers who were celebrating Easter Sunday. They also attacked luxury hotels frequented by foreigners, killing at least 250 people. It was one of the most lethal terrorist attacks since 9/11.

Any reports of ISIS's demise were premature. And, as Gen. Votel noted to me in his email, "We will have to keep pressure on this network. I would expect there is a succession plan -- we have seen this with many VEOs (Violent Extremist Organizations)."

Get our free weekly newsletter Sign up for CNN Opinion's new newsletter. Join us on Twitter and Facebook

The conditions that helped to produce ISIS remain, including the sectarianism that has torn apart countries, such as Iraq, Syria and Yemen. Also remaining are the weak or failing Middle Eastern states, such as Libya and Syria, in which jihadist terrorist organizations often thrive.

And, as we saw with the death of Osama bin Laden eight years ago, the ideology of jihadism is not extinguished with the death of any one leader.