KABUL, Afghanistan: Saturday night’s devastating attack on a wedding in Afghanistan’s capital comes amid huge uncertainty about the country’s future. The United States and the Taliban say they are nearing a deal to end America’s longest conflict, one that has lasted a generation and left tens of thousands dead. The US-Taliban talks have sidelined the government in Kabul, which is increasingly frustrated.

Meanwhile, the growing prominence of the local Daesh affiliate, suspected in the wedding attack, raises fears that whatever peace the US and Taliban might broker will not stop the killings of Afghan civilians.

Here is a look at the major players in the country:

UNITED STATES

It has been nearly 18 years since the US invaded Afghanistan in the wake of the 9/11 attacks to topple the Taliban-led government that harboured Al Qaida leader Osama Bin Laden, and now President Donald Trump is eager to bring the troops home. More than 2,400 US service personnel have died. The military says some 14,000 troops remain in the country after a presence that spiked to roughly 100,000 under President Barack Obama. Their combat mission formally ended in 2014 but they continue to train the Afghan military and conduct strikes on Daesh and the Taliban.

For nearly a year, US envoy Zalmay Khalilzad has been negotiating with the Taliban on issues including a US troop withdrawal and Taliban guarantees that would keep Afghanistan from again becoming a launch pad for global terror attacks.

THE TALIBAN

The extremist group ruled Afghanistan for five years, imposing their harsh interpretation of Islamic law before the US-led invasion, and many worry it might return in some form under an agreement with the US. The Taliban now control roughly half of Afghanistan and are at their strongest since their 2001 defeat. Their attacks have become so frequent and deadly that the Afghan and US governments now keep military casualty figures confidential. The Taliban refuse to negotiate with the Afghan government, calling it a puppet of the US. While the group’s political leaders have spoken of allowing limited women’s rights and protecting civilians in talks with a range of Afghan representatives earlier this year, no one knows how many of the group’s tens of thousands of fighters will follow them. Some fear that fighters unhappy with a deal with the US could join other extremist groups such as Daesh instead.

AFGHAN GOVERNMENT

President Ashraf Gani is openly frustrated at his government’s exclusion from the US-Taliban talks, and he insists that next month’s presidential election in which he seeks a second term is crucial for giving the government a strong mandate to deal with the Taliban in intra-Afghan talks that are expected to follow a US deal. While the Taliban have condemned Saturday night’s blast in Kabul, Gani said the group cannot absolve itself of blame because it provides a “platform for terrorists.” His government has said it is still waiting for details of Trump’s meeting on Friday with national security advisers on the progress of the US-Taliban negotiations.

DAESH AFFILIATE

Many suspect the local Daesh affiliate of carrying out Saturday’s bombing in a Shiite area of Kabul, as its brutal suicide bombings have killed hundreds of the Shiite minority Hazaras in the capital and elsewhere. The extremist group, which appeared in Afghanistan shortly after Daesh swept across Syria and Iraq in 2014, is committed to overthrowing the Afghan government on its path to establishing a global caliphate. While Daesh has since lost all the territory it once held in Iraq and Syria, its Afghanistan affiliate is still trying to expand its footprint.

The Taliban and Daesh are sharply divided over ideology and tactics, with the Taliban largely confining attacks to government targets and Afghan and international security forces. The Taliban and Daesh have fought each other on a number of occasions, and the Taliban are still the larger and more imposing force. A recent United Nation report estimated that the Daesh affiliate in Afghanistan numbers between 2,500 and 4,000.