Sen. Lindsey Graham plans to introduce legislation as early as next month to create a backstop measure in Afghanistan requiring the secretaries of state and defense to certify that dropping troop levels would not endanger U.S. national security, as President Trump moves toward agreeing to a phased withdrawal of troops, Fox News has learned.

The South Carolina Republican said it would be “devastating” to withdraw American service members from Afghanistan when there is clear evidence that the Taliban continues to harbor Al Qaeda foreign fighters -- the same conditions that led to the 9/11 attacks.

TRUMP HUDDLES WITH TEAM AMID AFGHANISTAN CONCERNS

The Washington Post was first to report on Graham’s planned legislation – meant to influence Trump.

U.S. Special Envoy Zalmay Khalilzad reportedly is negotiating a deal to draw down troops from 14,000 to below 8,600. Graham acknowledged the possibility that, even with the backstop measure, Trump could still approve a plan against the advice of two senior Cabinet secretaries.

Graham told the Washington Post: “It would be devastating for any president to withdraw forces from the country where the 9/11 attacks originated, after the secretaries of defense and state and the intelligence community said this would not be safe.”

Graham said intelligence reports alone did not provide the same visibility as eyes and ears on the ground. Critics of the talks point out that while the Taliban has negotiated with the United States, its propaganda has openly encouraged suicide attacks and blamed the U.S. for 9/11, while recent video out of the region shows foreign fighter activity in Nuristan.

“The Taliban continues to harbor foreign Al Qaeda fighters – the same conditions that led to 9/11,” said Thomas Joscelyn of the Long War Journal. “Based on past actions and statements, there is no way the Taliban can agree to a deal that leaves a residual U.S. force in Afghanistan.”

Over the weekend, more than 60 people were killed and nearly 200 others were wounded by a suicide bomber at a wedding hall in Afghanistan.

Joscelyn added: “With no boots on the ground, the U.S. will find it even more challenging to effectively track AQ and ISIS is Afghanistan. Al Qaeda is deeply embedded in the Taliban. And it is impossible to think the Taliban will eject them.”

Trump last Friday met with his top security officials about the way forward in Afghanistan. "Just completed a very good meeting on Afghanistan," the president tweeted afterward.

In a statement after the meeting, Secretary of State Mike Pompeo said, "Led by the president, we are working diligently on the path forward in Afghanistan. In continued close cooperation with the government of Afghanistan, we remain committed to achieving a comprehensive peace agreement, including a reduction in violence and a ceasefire, ensuring that Afghan soil is never again used to threaten the United States or her allies, and bringing Afghans together to work towards peace."

CLICK HERE TO GET THE FOX NEWS APP

The U.S. invaded the country in the wake of the 9/11 attacks in 2001, and plunged the country into an 18-year involvement – the longest in U.S. history. It has killed more than 2,000 American troops, injured more than 20,000 and cost nearly a trillion dollars since 2001.

The Taliban are at their strongest since the U.S.-led invasion toppled their five-year government in 2001 after the group had harbored Al Qaeda leader Usama bin Laden.

The Associated Press contributed to this report.