Christopher Miller is director of the National Counterterrorism Center in the Office of the Director of National Intelligence.

Remnants of the al-Qaeda terrorist organization that launched the 9/11 terror attacks 19 years ago remain active throughout the world. But it is now possible to see the contours of how the war against al-Qaeda ends.

The United States had three aims in this war: strengthen the country’s border defenses, pursue our enemies and facilitate our allies’ ability to lead the counterterrorism fight. We have succeeded in making it extremely difficult for terrorists to enter the United States to conduct cataclysmic attacks, and we have bolstered our allies’ capabilities.

As for pursuing our enemies, the campaign to defeat al-Qaeda began immediately after 9/11, when committed Americans and like-minded partners sallied forth to destroy the terrorists’ havens in Afghanistan and to wreck their command-and-control capabilities. Al-Qaeda can still direct others to commit acts of violence, as seen by the heinous killing of three Americans in Florida at Naval Air Station Pensacola last year, but it is no longer capable of conducting large-scale attacks.

Although I am now the director of the National Counterterrorism Center and a member of the intelligence community, my roots are as a soldier. My active service began on Dec. 5, 2001, with deployments in Afghanistan and Iraq. That experience, along with my post-Army service in the defense and intelligence fields, taught me about al-Qaeda — about its strengths and weaknesses.

My assessment now is that al-Qaeda is in crisis. The group’s leadership has been severely diminished by U.S. attacks. Its sole remaining ideological leader is Ayman al-Zawahiri, Osama bin Laden’s deputy on 9/11, who lives in hiding, no doubt fully aware of his vulnerability. If he is lucky, he will die of natural causes. Otherwise, the long arm of the United States will inevitably find him and bring him to justice, in one form or another.

Al-Qaeda’s forces are similarly in disarray and focused simply on survival. They are on the verge of collapse. It is essential for the United States to maintain focus in this final phase of a campaign that has been the calling of hundreds of thousands of Americans, often at great sacrifice.

The defeat of these terrorists is near, but experience has taught us that prematurely declaring “mission accomplished,” as we did with the war in Iraq in 2003, is to invite this Hydra-like beast to regenerate. The only counterterrorism truth is that constant pressure must be maintained on terrorist groups that have the intent or capability to attack us.

It is a testament to the achievements of those who have waged this war on al-Qaeda that we are now able to envision a future where terrorism is no longer the top national security priority but simply another threat that must be managed. With al-Qaeda’s inevitable demise, we will transition to allowing our like-minded partners to take the lead while we provide niche support, in areas such as intelligence and training. The United States will closely monitor terrorist groups and maintain a strike capability that can be used when our partners are unable to address threats themselves.

I don’t want to underestimate the challenges ahead. I am chastened by our failure to prevent the Islamic State’s rise from the ashes of al-Qaeda in Iraq. Counterterrorism efforts today include not only preventing terrorists’ acquisition and use of chemical, nuclear or biological weapons, but also fighting against the use of the Internet and other evolving technologies for terrorist purposes.

The international community must also deal with thousands of Islamic State members who fought in Syria and Iraq and have dispersed to other countries. Fortunately, as was not the case with the foreign-fighter diaspora after the Soviet-Afghan war of the 1980s, U.S. law enforcement and military members have collected biometric information on the overwhelming majority of Islamic State prisoners, making it extremely difficult for those who escaped or were released to evade detection in the future. Regardless, it is inevitable that the United States will continue to be attacked by Islamist fundamentalists who hate our freedoms and our values.

Al-Qaeda misgauged the United States’ enormous resolve and fortitude. We did not seek or desire the war the terrorists started. But we will end the war on our terms. Other individuals and groups who want to harm Americans should study our war against al-Qaeda: We will pursue terrorists to the ends of the Earth, never stopping until the job is done.

Read more: