After forty years as a largely autonomous British protectorate, Afghanistan became independent in 1919. Since the 1970s, the country has been characterized by civil war as Muslim groups have battled the regime and each other in their attempts for control, often with input from the Soviet Union. Discontent with the rule of local warlords led to the sudden growth of the Taliban in the mid-1990s, which controlled the government in 1996-2001. The Taliban established a strict Islamic state until it was ousted in late 2001, when a US-led multinational force intervened. However, the extremists continued their struggle and heavy fighting between the new internationally-backed regime.
The nationwide conflict between the Taliban and other militant Islamic groups (the Haqqani network, the Hezb-e Islami, and various other groups) on the one hand, and with the government (backed by the NATO-led Resolute Support Mission (RSM), as well as US troops) on the other, continues at the level of a full-scale war, revolving around national power and the orientation of the political system. In less than a decade, military expenditure has increased from 1.66% of GDP to 15.75%, while violence as a whole costs the Afghan economy 45% of its GDP. In July 2016, US President Obama announced that 8,400 US forces would remain in the country until the end of his presidency, while in the same month the states contributing to the RSM agreed to sustain their presence beyond 2016. The UN mission to Afghanistan (UNAMA) estimated that there were at least 11,000 civilians casualties in the country in 2016, with around 3,5000 killed. Ground operations, suicide attacks, and IEDs caused the majority of civilian casualties, with an additional 636,500 people internally displaced. In addition, 6,785 Afghan National Defence Security Forces were killed in 2016. 
There is also concern about a growing IS influence in the country, especially in the region bordering Pakistan, with IS targeting both the government and the Taliban. US drone strikes have also affected Afghanistan, with 32 militants being killed in the tribal regions in Pakistan and Afghanistan. 

Map: CIA World Factbook

Peace attempts

The UN has been an important actor in the conflict in Afghanistan, serving as a third party in negotiations since the 1980s. Extensive talks and several UN resolutions eventually led to the Soviet Union withdrawing from Afghanistan and a peace plan for the county in 1991. However several Mujahideen groups refused to participate in subsequent negotiations and heavy fighting erupted in 1992. UN-led meetings with the warring parties in 1994 and 1995 failed to bring an end to the fierce fighting, as did the Organisation of Islamic Conference (OIC) arranged peace talks. When the Taliban movement captured Kabul in 1996 both Pakistan and the UN brokered peace talks between them and their opposition (a coalition of Mujahideen groups), but no progress was reported. Several attempts at peace talks were attempted prior to the foreign mission that ousted the Taliban in 2001, but to no avail. Since then, massive diplomatic efforts have been initiated by the UN in order to create a stable government for Afghanistan and the Taliban have refused invitations for negotiations.

The UN-led political mission in Afghanistan (UNAMA) began in 2002, to assist the Afghan government in democratic transition and the establishment of the rule of law. It had its mandate extended for one year from March 2016. In 2003, NATO took the lead of the ISAF mission in Afghanistan, with the primary objective of enabling the Afghan government to provide security and develop new forces to eliminate terrorism. From 2011, responsibility for security was gradually transitioned to Afghan forces, which took the lead for security operations across the country by 2013. The transition process was completed and Afghan forces assumed full security responsibility at the end of 2014. However, NATO member states agreed on a non-combat follow-on mission (the Resolute Support Mission), comprising of 2,000 forces and starting early 2015. The Mission aims to provide further training, advice and assistance to the Afghan security forces and institutions. In October 2016 the states contributing to the RSM pledged an additional $15.2bn in financial aid to the Afghan government until 2020. The USA and Afghanistan also signed a Bilateral Security Agreement, enabling an additional contingent of 9,800 US troops to remain deployed. 
In 2016 the Afghan government signed a ceasefire with Hezb-i-Islami, including an amnesty for its leader. The government also continued talks with Pakistan over the possibility of beginning peace negotiations with the Taliban.