The Taliban have taken control of Afghanistan, almost 20 years after being ousted by a US-led military coalition.
Emboldened by the withdrawal of US troops, they now control all key cities in the country, including Kabul.
Rapid advance in recent days
The Taliban took some areas from government by force. In other areas, the Afghan National Army withdrew without a shot being fired.
Although renewed clashes had been going on for several weeks, from 6 August the Taliban made a more rapid advance across the country, as they took control of provincial cities.
The maps below start in early July and show the 400 or so government districts as they fell to the Taliban.
US forces based outside Afghanistan had launched air strikes against Taliban positions earlier last week, but they failed to slow the advance of the insurgents.
Although most US troops left in July, several thousand returned to Kabul at the weekend to help evacuate American and allied personnel from the capital.
The airport in the capital was the only official route out of the country after the Taliban took control of all the major border crossings.
Customs duty on goods entering the country via crossings they control is now collected by the Taliban - although exact amounts are unclear as the volume of trade has fallen as a result of the fighting.
But, Islam Qala on the border with Iran was, for example, capable of generating more than $20 million per month.
Disruption to the flow of imports and exports has affected prices of essential goods in the markets - fuel and foodstuffs in particular.
Billions spent tackling Taliban
US troops and their Nato and regional allies forced the Taliban from power in November 2001. The group had been harbouring Osama Bin Laden and other al-Qaeda figures linked to the 11 September 2001 attacks in the US.
But despite a continued international presence in the region, billions of dollars of support and training for the Afghan government forces, the Taliban regrouped and gradually regained strength in more remote areas.
A BBC study in 2017 showed the Taliban were in full control of a number of districts. But the research also showed they were active in many other parts of the country, mounting weekly or monthly attacks in some areas, suggesting significantly higher strength than previous estimates.
In 2017 about 15 million people - half the population - were reported to be living in areas either controlled by the Taliban or where the Taliban were openly present.
Additional reporting by BBC Afghan service