American soldiers wait on the tarmac in Logar province, Afghanistan, Nov. 30, 2017. The longest direct talks ever held between the United States and the Taliban concluded this week with both sides citing progress toward ending the 17-year war, but many questions remain unanswered. Credit: Rahmat Gul | AP

Talks between the Taliban and U.S. over ending the 18-year conflict in Afghanistan made headway on Tuesday over a draft agreement on American troop withdrawals and counter-terrorism promises.

Two issues remain outstanding after the 14-day talks between U.S. negotiations led by envoy Zalmay Khalilzad and senior Taliban officials in Doha, Qatar — a ceasefire agreement and dialogue with the Afghan government, which the Taliban sees as illegitimate.

Both sides are “quite serious in reaching an agreement that could end the war,” said Sayed Akbar Agha, a former senior Taliban official in Kabul who is in contact with the insurgents. “Their meeting ended with hopes and optimism.” Agha said that both sides may meet again next month, though neither the U.S. or Taliban have confirmed when the next set of talks will take place.

Washington has increased efforts to end its longest war through negotiations in the past year. Regular attacks by the Taliban and fighting between insurgents and Afghan President Ashraf Ghani’s troops have displaced 1.7 million people and killed tens of thousands. Meanwhile, Taliban, which controls or contests half of the Afghan territory, intensified its attack on government forces amid the talks.

While both sides didn’t flesh out the details of the draft accords, they have sparred over the troop-pullout timeline. The Taliban wants the U.S. to leave the country within a year, while Washington pushed for three to five years and assurances that the Taliban wouldn’t allow terror groups to use Afghanistan as a base, according to two former Taliban officials.

Taliban spokesman Zabihullah Mujahed said in a statement they had “extensive and detailed discussions” on the two issues and both sides will share the “achieved progress” with their leaderships and prepare for the upcoming meeting.

The militants have repeatedly rebuffed Ghani’s call to hold direct talks with his administration. Khalilzad added that after reaching an agreement on the two issues, the Taliban will then begin intra-Afghan negotiations on a political settlement and comprehensive ceasefire.

“It’s clear all sides want to end the war,” Khalilzad, who left for Washington to brief U.S. Secretary of State Mike Pompeo, said on Twitter late Tuesday. “Despite ups and downs, we kept things on track and made real strides — we will meet again soon, and there is no final agreement until everything is agreed.”

Meanwhile, the Taliban, which controls or contests half of Afghanistan, has intensified attacks on government forces aimed at gaining more leverage in the talks.

The militants stormed several army checkpoints in western Badghis province on Sunday, killing as many as 20 Afghan soldiers and capturing about 20 others after three days of fighting, according to Mohammad Naser Nazari, a member of the provincial council. The Taliban also suffered heavy casualties, he said.

The group also stormed a key army base that also houses U.S. troops in southern Helmand province on March 3, killing more than 20 Afghan troops.

Many in Kabul now fear a return in some form of the harsh Taliban regime that ruled Afghanistan from the mid-1990s to 2001.

“Peace is imperative and needed urgently, but not at any cost,” Hamdullah Mohib, Ghani’s national security adviser, told the United Nations Security Council on March 11. “The process must be inclusive and representative of the new Afghanistan, not a deal made between elites.”