Donald Trump has met his peace envoy to Afghanistan and top security advisers to discuss progress in the latest round of talks with the Taliban, fuelling speculation that a deal to end America’s longest war might be within reach.

“Many on the opposite side of this 19-year war, and us, are looking to make a deal – if possible!” Trump tweeted after the meeting at his golf club in New Jersey, where the group is believed to have discussed a draft peace plan.

The meeting brought together Trump’s Afghan peace envoy, Zalmay Khalilzad, secretary of state Mike Pompeo, vice-president Mike Pence, national security adviser John Bolton and the heads of the military and CIA.

However, in a reminder of the many possible obstacles to any settlement, a bombing in Pakistan killed the brother of Taliban leader Haibatullah Akhundzada shortly before Trump’s discussions in the US.

The attack hit a mosque where Akhundzada had served as an imam before his appointment as head of the Taliban, and which he sometimes still visits. A Pakistani official told the New York Times he believed the commander was the real target.

The Taliban and the US have held talks in Qatar several times this year to formulate a deal, ahead of an informal September deadline, and the broad outlines of an agreement are now thought to be fixed.

The framework would allow for a phased withdrawal of US troops, with the Taliban committed in return to severing ties with al-Qaida, and to preventing them and other extremist groups from operating in, or from, areas they control.

That would allow Trump to claim success in his long-standing goal of ending the US’s longest war and bringing 14,000 troops home. The Taliban would be able to claim it had achieved its central aim of driving out foreign troops.

However, the draft plan leaves vital areas to be hammered out: most pressingly, how Afghanistan will be ruled once the US has left, and when both sides might lay down arms.

Women's rights activists are concerned that their gains over the past 20 years might be destroyed by the Taliban

For years, the Taliban has refused to meet with Afghan officials, denouncing them as US puppets. Although any peace deal is expected to include provisions for talks between militants and the government, it is not clear whether the US will make a full withdrawal contingent on a comprehensive agreement between its allies and the Taliban, or on a national ceasefire.

Without clarity on power sharing in Kabul, critics fear the end of America’s Afghan war might just open a new phase of conflict for Afghans themselves. Memories of the brutal civil war that followed the Soviet withdrawal in 1989 are still fresh for many.

And even Trump’s allies at home have warned against withdrawing all counter-terrorism troops after the regional Isis affiliate established a firm foothold in the country, fighting both the Taliban and government troops for territory. Senator Lindsey Graham said the US needed to keep boots on the ground to pursue Isis and al-Qaida.

The Taliban controls more Afghan territory today than at any point since it was ousted by US forces in 2001 and, in a demonstration of strength, launched a string of brutal attacks even as peace talks continued.

One recent bombing targeted the former spy chief and vice-presidential candidate Amrullah Saleh, while another hit a museum and TV station, injuring dozens of children at a nearby school.

Women’s rights activists are particularly concerned that their gains over the past 20 years might be destroyed by the Taliban, or traded away for a form of peace by a weakened Kabul administration.

The Taliban claims to have changed some policies since its hardline rule in Kabul, when women were barred from education and most work, had to wear the all-enveloping burqa and needed permission from male relatives to access healthcare and travel.

It claims now to encourage girls’ education and other women’s rights within an Islamic sharia system, but has refused to detail what those rights include. Its treatment of women in areas it controls suggests it still favours severe restrictions on their lives and freedoms.