Under the agreement signed between the Trump administration and the Taliban a large portion of the troops had left the country by early 2021.
Biden claimed that "When I came into office, I inherited a deal that President Trump negotiated with the Taliban. Under his agreement, U.S. forces would be out of Afghanistan by May 1, 2021, just a little over three months after I took office. U.S. forces had already drawn down during the Trump administration from roughly 15,500 American forces to 2,500 troops in country. And the Taliban was at its strongest militarily since 2001."
We decided to fact check the assertions made by Biden. In February 2020, the Trump administration negotiated a withdrawal agreement with the Taliban militants that excluded the Afghan government. That agreement led to the freeing of 5,000 imprisoned Taliban soldiers, and the government decided on May 1, 2021, for the final withdrawal.
In light of this agreement, the U.S. started reducing U.S. troop levels from about 13,000 to 2,500. However, at the same time, the "Taliban continued to attack Afghan government forces and welcomed al-Qaeda terrorists into the Taliban leadership," noted factcheck.org.
But when Biden took office, he delayed the May 1 deadline and decided to withdraw by August 31 completely. However, this decision was confirmed even though the Taliban was growing stronger every day, eventually increasing attacks, and it did not comply with the agreement. The Taliban had stated that its goal was to create an “Islamic government” in Afghanistan after the U.S. left, even if it meant it had to “continue our war to achieve our goal.” The Taliban has been behind over 30 attacks in Afghanistan this year alone, resulting in over 174 deaths and several injuries.