stylistic:tone, structural:scholar_edition
Second Taliban era

NATO Secretary General Jens Stoltenberg announced on 14 April 2021 that the alliance had agreed to start withdrawing its troops from Afghanistan by 1 May. Soon after NATO troops began withdrawing, the Taliban launched an offensive against the Afghan government and quickly advanced in front of collapsing Afghan government forces. The Taliban captured the capital city of Kabul on 15 August 2021, after regaining control over a vast majority of Afghanistan. Several foreign diplomats and Afghan government officials, including president Ashraf Ghani, were evacuated from the country, with many Afghan civilians attempting to flee along with them. On 17 August, first vice president Amrullah Saleh proclaimed himself caretaker president and announced the formation of an anti-Taliban front with a reported 6,000+ troops in the Panjshir Valley, along with Ahmad Massoud. However, by 6 September, the Taliban had taken control of most of Panjshir province, with resistance fighters retreating to the mountains. Clashes in the valley ceased mid-September.

According to the Costs of War Project, 176,000 people were killed in the conflict, including 46,319 civilians, between 2001 and 2021. According to the Uppsala Conflict Data Program, at least 212,191 people were killed in the conflict. Though the state of war in the country ended in 2021, armed conflict persists in some regions amid fighting between the Taliban and the local branch of the Islamic State, as well as an anti-Taliban Republican insurgency.

The Taliban government is led by supreme leader Hibatullah Akhundzada and acting prime minister Hasan Akhund, who took office on 7 September 2021. Akhund is one of the four founders of the Taliban and was a deputy prime minister of the previous emirate; his appointment was seen as a compromise between moderates and hardliners. A new, all-male cabinet was formed, which included Abdul Hakim Haqqani as minister of justice. On 20 September 2021, United Nations Secretary-General António Guterres received a letter from acting minister of foreign affairs Amir Khan Muttaqi to formally claim Afghanistan's seat as a member state for their official spokesman in Doha, Suhail Shaheen. The United Nations did not recognize the previous Taliban government and chose to work with the then government-in-exile instead.

Western nations suspended most of their humanitarian aid to Afghanistan following the Taliban's August 2021 takeover of the country; the World Bank and International Monetary Fund also halted their payments. More than half of Afghanistan's 39 million people faced an acute food shortage in October 2021. Human Rights Watch reported on 11 November 2021 that Afghanistan was facing widespread famine due to an economic and banking crisis. The Taliban have significantly tackled corruption, now being placed as 150th on the corruption watchdog perception index. The Taliban have also reportedly reduced bribery and extortion in public service areas. At the same time, the human rights situation in the country has deteriorated. Following the 2001 invasion, more than 5.7 million refugees returned to Afghanistan; however, in 2021, 2.6 million Afghans remained refugees, primarily in Iran and Pakistan, and another 4 million were internally displaced.

In October 2023, the Pakistani government ordered the expulsion of Afghans from Pakistan. Iran also decided to deport Afghan nationals back to Afghanistan. Taliban authorities condemned the deportations of Afghans as an "inhuman act". Afghanistan faced a humanitarian crisis in late 2023.