WASHINGTON -- Under an agreement signed in Doha, Qatar, all foreign troops may be out of Afghanistan in 14 months, officials said in the Afghan capital of Kabul.Afghan President Ashraf Ghani, Defense Secretary Dr. Mark T. Esper and NATO Secretary General Jens Stoltenberg all said Saturday that any withdrawal would be conditions-based, and the Taliban would have to negotiate with Afghan officials for the process to move forward.Esper and Stoltenberg traveled to Kabul to meet with Afghan leaders and discuss the joint declaration.Under the declaration, the Taliban have agreed to counterterrorism guarantees, Afghan-to-Afghan negotiations, a ceasefire and condition-based withdrawal of foreign forces."Today's release of the joint declaration between the Islamic Republic of Afghanistan and the United States marks a pivotal moment in the peace process," Esper said during a ceremony at the Afghan palace. "Our declaration acknowledges the deep bond shared by Afghan and U.S. forces, and reflects our commitment to working together to achieve a sustainable, negotiated agreement that ends the war, for the benefit of all Afghans. Central to this agreement are measures to prevent the use of Afghan soil by terrorist groups or other individuals who seek to harm the United States or our allies."Esper said the result of the weeklong ceasefire in the country were encouraging.But the Taliban do not get a free pass. "We call on the Taliban to abide by their commitments as outlined in the agreement with the United States, to include maintaining the ongoing reduction in violence across the country," Esper said. "As intra-Afghan negotiations progress, the United States will watch the Taliban's actions closely to judge whether their efforts towards peace are in good faith."If the Taliban uphold the agreement, the United States and other members of the coalition will begin a conditions-based reduction in forces, the secretary said. "However, should the Taliban fail to honor their commitments, they will forfeit their chance to sit with fellow Afghans and deliberate on the future of their country," he added. Moreover, the United States would not hesitate to nullify the agreement."Stoltenberg said all NATO nations and partners in the coalition welcome the declaration, calling it a victory for peace and the Afghan people.He noted that Afghanistan is a very different country from what it was in 2001. "It is no longer a safe haven for international terrorists, terrorists who conducted the attacks against the United States and threatened people across the globe," the secretary general said. "The security we have helped the Afghan forces to build has underpinned political, economic and social progress. Child mortality has dropped dramatically. Life expectancy has increased significantly, and millions more Afghans are in school, including girls."While the agreement is between the United States and the Taliban and the Afghan government, NATO will conform with it, Stoltenberg said."NATO will reduce its presence in Afghanistan step-by-step and conditions-based and reflecting the progress we see on the ground," he said. "NATO allies and partners went into Afghanistan together. We will adjust our presence together. When the time is right, we will leave together. This will only happen when we are sure that the Afghan forces no longer require our support, and that Afghanistan will never again become a platform for international terrorists."The road to peace will not be easy, Esper said. Violence and civil war in Afghanistan goes back long before the al-Qaida attack on the United States in 2001."Achieving lasting peace in Afghanistan will require patience and compromise among all parties," the secretary said. "But for the first time in many years, Afghanistan has a real path toward the future this country deserves. We look forward to the coming weeks and months with great optimism, as we advance these important efforts to finally achieve peace."