Sen. Lindsey O. Graham (R-S.C.) on Sunday publicly warned President Trump against a full or precipitous withdrawal of U.S. troops from Afghanistan, days ahead of an unofficial Sept. 1 deadline for a deal.

The United States and the Taliban are close to announcing an agreement on an initial U.S. troop withdrawal, along with plans to start direct discussions between the militants and the Afghan government, American and foreign officials told The Washington Post earlier this month.

Under the proposed deal, the initial withdrawal would include roughly 5,000 of the 14,000 U.S. troops in the country.

Graham said Sunday that he is worried Trump will go further than that. He argued that maintaining a robust counterterrorism force is necessary because it’s “an insurance policy against another 9/11.”

“The number is going to be around 8,600,” Graham said of U.S. troop levels in an interview on CBS’s “Face the Nation.” “To go below that, I think, would be really risky.”

According to the proposed deal, the Taliban would agree to renounce al-Qaeda and to bar it from activities such as fundraising, recruiting, training and operational planning in areas under Taliban control.

Graham, one of Trump’s closest allies on Capitol Hill, has repeatedly warned the president not to trust the Taliban to control al-Qaeda and other militant groups in Afghanistan. Some within the Trump administration have sent the same message.

Trump has maintained that bringing U.S. troops home from Afghanistan is his long-term priority. On Sunday, Graham said Trump and his would-be 2020 Democratic presidential rivals are “all wrong” on the issue.

“In one day, we lost 3,000 Americans because we took our eye off the ball in Afghanistan. . . . Mr. President, if you don’t have a counterterrorism force left behind, even if you gotta deal with the Taliban — which I doubt, but you might — they don’t have the capability or will to protect the American homeland,” Graham said.

He called lowering the cost of the 18-year war “a noble endeavor” but warned that it would be “disastrous” to “outsource our national security to the Taliban.”

“I am concerned that the president, in his desire to get out, is going to make the same mistake that President Obama did in Iraq,” Graham said, referring to the former president’s decision to withdraw all combat troops from Iraq at the end of 2011. “I don’t want you to be like Bernie Sanders or Elizabeth Warren. I want you to take good, sound military advice.”