As President Trump moves toward a deal with the Taliban to withdraw U.S. troops from Afghanistan, Sen. Lindsey O. Graham (R-S.C.), a frequent political ally, issued a sharp warning Friday that removing all U.S. troops while a terrorist threat remains there would be “reckless and dangerous.”

Because of continuing terrorist danger from the Afghanistan affiliates of the Islamic State and al-Qaeda, which the Taliban can’t control, “There is no possibility to leave Afghanistan completely without severe risk to the homeland,” Graham said in a telephone interview. “If we give in to the Taliban’s demand to completely withdraw, that would deny our ability to protect” the United States and its allies against future terrorist attacks.

Graham’s sharp comments seemed intended mainly for an audience of one — Trump himself. Graham has frequently defended controversial decisions by Trump, but on Afghanistan he clearly believes that the potential dangers for the United States of total withdrawal transcend the short-term political benefits of what would be a popular peace agreement heading into the 2020 election year.

“It would be a political decision, not a military one, and it would have consequences more severe than [Barack] Obama’s decision to withdraw from Iraq,” Graham said of a total U.S. pullout. He continued: “If we go to zero [troops], we will have a virtual open-border policy toward Afghanistan.”

Graham concluded the brief interview with a direct political shot that invoked Trump’s most left-wing Democratic challenger: “To go to zero would be reckless and dangerous — against sound military advice, [and instead following] Bernie Sanders’s military advice. I didn’t sign up for Bernie Sanders’s foreign policy.”

Read more: