DOHA, Qatar (AP) — The United States and the Taliban have signed an historic peace agreement aimed at ending the 18-year war in Afghanistan, America's longest.

The signing could help President Donald Trump fulfill a key campaign promise to extract America from its “endless wars” and bring American troops home from far-flung conflicts.

Under the agreement, the U.S. will begin withdrawing thousands of soldiers if the Taliban meet commitments to prevent Afghanistan from being a launchpad for terrorist attacks.

If the Taliban comply, all U.S. and allied troops would leave in 14 months.

The U.S. invaded Afghanistan after the Sept. 11, 2001 attacks to overthrow the Taliban, who had hosted Osama bin Laden and al-Qaida as they planned and celebrated the assault.

Enter your number to get our free mobile app