American troops have begun pulling out of Afghanistan as part of a peace agreement between the United States and the Taliban.

The U.S. is reducing its troop presence in the country from 13,000 to 8,600, as required by the deal, and has started shipping hundreds of soldiers out of the Middle East, officials announced Monday.

"In accordance with the U.S.-Islamic Republic of Afghanistan Joint Declaration and the U.S.-Taliban Agreement, U.S. Forces Afghanistan (USFOR-A) has begun its conditions-based reduction of forces to 8,600 over 135 days," U.S. Forces Afghanistan spokesman Col. Sonny Leggett said.

"USFOR-A maintains all the military means and authorities to accomplish our objectives—including conducting counterterrorism operations against al-Qaeda and ISIS-K and providing support to the Afghan National Defense and Security Forces," he added. "USFOR-A is on track to meet directed force levels while retaining the necessary capabilities."

Chaos in Afghanistan’s highest level of government, however, may undermine the U.S.-Taliban treaty. Two rival political leaders were each sworn in as president of the country in separate Monday ceremonies. Afghan President Ashraf Ghani was declared the winner of the most recent election, but Abdullah Abdullah charged that Ghani won through voter fraud.

The peace deal does not specify if or when the U.S. will leave Afghanistan entirely or end the 18-year war with the Taliban. American military officials will assess conflict in the country after the U.S. reaches the 8,600 troop threshold and begins to pull out the remaining forces if more security agreements are met.

On March 1, Ghani rejected part of the U.S.-Taliban peace agreement that included a prisoner swap of 5,000 Taliban prisoners in exchange for 1,000 Afghan security force members. The Afghan president said that the prisoner swap might be used to negotiate a lasting deal, but it would not be part of a set of preconditions for talks to continue.