A NATO soldier stands guard last month under the wing of a C-130 Hercules aircraft that belongs to the Afghan National Army in Kandahar Air Field, Afghanistan. (Massoud Hossaini/Associated Press)

Mac Thornberry, a Republican, represents Texas’s 13th Congressional District in the House and is chairman of the Armed Services Committee.

Fourteen years ago, America’s longest war began. The plot that led to the murder of 2,977 people on Sept. 11, 2001, originated in Afghanistan. Since then, more than 2,350 U.S. service members have sacrificed their lives in Afghanistan to help ensure that no more innocent Americans are victims of such savagery. Now, the results of that sacrifice and the future of Afghanistan, as well as the extent of the ongoing terrorist threat to our homeland, hang on crucial decisions about to be made as President Obama decides how many troops, if any, will stay in Afghanistan through 2016.

A lot has changed in Afghanistan. Nearly a year ago, President Ashraf Ghani was sworn into office, with his campaign rival Abdullah Abdullah agreeing to serve as chief executive of a national unity government. This government is coping with the fallout of a Pakistani offensive that pushed militants across the border into Afghanistan; the consequences of a power struggle resulting from Taliban leader Mohammad Omar’s death, including high-profile bombings in Kabul; and the disturbing growth of the terrorist group known as ISIS or the Islamic State inside the country. Simultaneously, international assistance has been cut and coalition forces withdrawn — from approximately 100,000 in 2011 to fewer than 10,000 today. Now Afghans face the prospect that no coalition troops will remain at the end of 2016.

In 2013, the U.S. military developed a plan to remove Americans from most combat operations in Afghanistan while still helping to develop the Afghan forces’ security capabilities. The Obama administration disregarded the plan. Most bases and outposts were closed, and troops were cut below the minimum needed to successfully train and assist the Afghan military. Now, in addition to terrorist attacks, the Afghan military is in a tough fight without the key resources required to battle an insurgent campaign. Tragically, strategic territory that U.S. troops fought and sacrificed to secure may be lost.

The current plan is to end any meaningful U.S. military presence in Afghanistan by December 2016, closing the few remaining U.S. bases in the country and foreclosing any real ability to effectively advise and support the Afghan military. A resurgent Taliban and Haqqani network, which continue to protect al-Qaeda, could then make further gains across Afghanistan, threatening the country’s stability and allowing the return of pre-9/11 conditions. Closing those bases would also eliminate much of the intelligence collection pertaining to threats against the U.S. homeland.

After 14 years of war, why should we stay engaged in a poor country so far away? First, Afghanistan has been and will continue to be a crucial center for terrorist organizations. It was al-Qaeda’s base as it plotted 9/11 and other attacks, and the group continues to try to reconstitute itself there. ISIS is growing rapidly within Afghanistan. Only by staying engaged can we fight that threat at its source, rather than waiting for it to come to us.

Another reason is we have a motivated partner. Afghanistan’s national unity government is anxious to work closely with the United States and has security forces willing and able to do the fighting. By providing modest financial support and a limited presence to advise and conduct counterterrorism, we will be in solid position to take direct action against key terrorist targets.

Visiting Afghanistan this month, I found unanimous agreement that Afghan security forces have made enormous strides. But they are not yet ready to take on the national and international security challenges they face on their own; essential functions such as intelligence and close air support need more time to develop. And they are anxious for sustained U.S. advisory help.

A third reason is credibility. If we expect other nations to join the fight against terrorists, the United States has to prove itself a reliable partner. That reliability is in doubt after our premature withdrawal from Iraq, the never-enforced red line in Syria and a nuclear deal that does nothing to curtail Iran’s malignant activities in the region. Complete withdrawal from Afghanistan would cause any country to question the wisdom of an alliance with the United States.

Right now, we face the danger of repeating the mistake of Iraq, where a new, more virulent terrorist threat has grown after the United States left too soon. If we make the same mistake in Afghanistan, the danger to the homeland and to American citizens and interests around the world will grow significantly.

Fourteen years after 9/11, the United States faces many complex security threats. But Afghanistan remains a central node in the terrorism fight. It would be a tragic mistake for the United States to disengage from a fight where we have a willing partner and where so much can be accomplished at a relatively modest cost. We do not want to look back one day and wish we had chosen a different course.