Survivors walk after a blast in Kabul. (Mohammad Ismail/Reuters)

John McCain (R-Ariz.) is chairman of the Senate Armed Services Committee. Lindsey Graham (R-S.C.) is a member of the committee.

On Sept. 11, 2001, al-Qaeda terrorists murdered 3,000 innocent civilians on American soil while under the sanctuary of the Taliban regime in Afghanistan. In response to that attack, U.S. and NATO forces deployed to Afghanistan to hunt down those responsible and ensure that Afghanistan would never again be a haven for terrorists. Since then, more than 2,000 Americans and more than 1,000 troops from our NATO allies have given their lives to that mission.

But after more than a decade-and-a-half of war, Gen. John W. Nicholson, commander of U.S. and coalition forces in Afghanistan, told the Senate Armed Services Committee last month that the war in Afghanistan is in a stalemate. President Trump and his administration must treat Afghanistan with the same urgency as the fight against the Islamic State, or this stalemate risks sliding into strategic failure.

This month, two simultaneous suicide attacks by the Taliban in Kabul killed at least 16 people and wounded more than 40. In northern Afghanistan, the Taliban overran another district. These setbacks came on the heels of disturbing losses across the country. Nicholson recently confirmed an inspector general report that the Afghan government controls or influences just 57 percent of the country’s districts, down from 72 percent just over a year ago.

Make no mistake: Afghans are fighting ferociously to defend their country from our common enemies. At the same time, we must recognize that the United States is still at war in Afghanistan against the terrorist enemies who attacked our nation on Sept. 11 and their ideological heirs. We must act accordingly.

Unfortunately, in recent years, we have tied the hands of our military in Afghanistan. Instead of trying to win, we have settled for just trying not to lose.

Time and time again, we saw troop withdrawals that seemed to have more to do with U.S. politics than conditions on the ground. The fixation with “force management levels” in Afghanistan, as well as in Iraq and Syria, seemed more about measuring troop counts than measuring success.

Authorities were also tightly restricted. Until last summer, our military was prohibited from targeting the Taliban, except in the most extreme circumstances, taking the pressure off the militants and allowing them to rebuild and reattack. Indeed, while we were fighting the Islamic State in Syria and Iraq, authorities in Afghanistan were so restrictive that it took an entire year before U.S. forces were finally given authority to strike the group’s fighters in Afghanistan.

While we have settled for a “don’t lose” strategy, the risk to U.S. and Afghan forces has only grown worse as the terrorist threat has intensified.

The Taliban has grown more lethal, expanded its territorial control and inflicted heavy casualties on Afghan forces. And it is reportedly doing so with help from Iran and Russia, who want nothing more than to see the United States fail in Afghanistan.

Al-Qaeda and the Haqqani network continue to threaten our interests in Afghanistan and beyond.

The Islamic State is trying to carve out another haven from which it can plan and execute attacks.

Moreover, U.S. efforts to confront these terrorist threats are continually frustrated by terrorist sanctuaries in Pakistan used to attack across its border and kill U.S. forces. Deteriorating relations between Pakistan and Afghanistan only make this problem more difficult.

Trump has an important opportunity to turn the page, seize the initiative and take the fight to our terrorist enemies. To do this, the United States must align ends, ways and means in Afghanistan.

The U.S. objective in Afghanistan is the same now as it was in 2001: to prevent terrorists from using the country’s territory to attack our homeland.

We seek to achieve this objective by supporting Afghan governance and security institutions as they become capable of standing on their own, defending their country and defeating our common terrorist enemies with less U.S. assistance over time.

Doing this successfully requires the right number of people in the right places with the right authorities and the right capabilities. Our assessment, based on our conversations with commanders on the ground, is that a strategy for success will require additional U.S. and coalition forces and more flexible authorities. It will also require sustained support of the Afghan security forces as they develop key capabilities, especially offensive capabilities such as special operations forces and close air support needed to break the stalemate.

The United States has been at war in Afghanistan for nearly 16 years. Weary as some Americans may be of this long conflict, it is imperative that we see our mission through to success. We have seen what happens when we fail to be vigilant. The threats we face are real. And the stakes are high — not just for the lives of the Afghan people and the stability of the region, but for America’s national security.