DOHA, Qatar — American negotiators and Taliban officials set to resume negotiations in the Qatari capital on Saturday expressed guarded optimism that they are getting closer to an agreement that could help end 17 years of conflict, America’s longest war.

During a two-day break from direct negotiations at a holiday resort in Doha, a series of small meetings continued around town to bridge the gap on core issues, such as withdrawal of American troops and prohibiting international terror groups from using Afghan soil, according to several current and former officials from all sides involved in the talks.

“There is progress,” Sohail Shaheen, a spokesman for the Taliban’s negotiating team, said in an interview on Friday. “The technical groups are working on the details of a draft agreement about troop pullout from Afghanistan, and also that Afghanistan’s soil must not be a haven for anyone to use it against other countries. We have moved the agreement forward, but we have not completed it.”

But a host of complications remain, including the continued violence, as neither side has given up making attacks. Even as negotiators were sounding hopeful in Doha, Taliban fighters assaulted a large Afghan Army base in Helmand Province where United States Marines are present, killing at least two dozen Afghan soldiers.