The Trump administration is preparing to withdraw thousands of troops from Afghanistan in exchange for concessions from the Taliban, including a cease-fire and a renunciation of al-Qaeda, as part of an initial deal to end the nearly 18-year-old war, U.S. officials say.

The agreement, which would require the Taliban to begin negotiating a larger peace deal directly with the Afghan government, could cut the number of American troops in the country from roughly 14,000 to between 8,000 and 9,000, the officials said. That number would be nearly the same as when Donald Trump took office.

The plan has taken shape after months of negotiations between the Taliban and Zalmay Khalilzad, an Afghan-born American diplomat who was appointed by the Trump administration last year to jump-start talks. Officials said an agreement could be finalized ahead of the Afghan presidential election in September, though they cautioned that Taliban leaders could delay and that significant challenges remain.

The proposal is likely to be viewed skeptically by some U.S. and Afghan officials who question the Taliban’s honesty and wonder how the United States can verify whether Taliban leaders are following through. But if approved, it would be one of the most significant steps toward ending the war, a goal that increasingly has bipartisan support.