Video on social media shows hundreds of inmates leaving the Afghan jail after heavy militant attacks.
The Taliban say they have captured a prison in the northern Afghan province of Jawzjan and freed all of the prisoners.
Video on social media shows hundreds of inmates leaving the jail in the city of Sheberghan on Saturday after the insurgents launched an attack.
The Taliban have taken control of the city, making it the second regional capital to fall to the militants.
It is a major blow to security forces, as battles escalate across the country.
Sheberghan is a stronghold of the former Afghan vice-president and warlord, Abdul Rashid Dostum, whose supporters have been leading the fight against the insurgents.
Local media reports that 150 people travelled to the city to help Afghan forces.
The Taliban first took control of the governor’s compound on Friday during intense fighting, before it was retaken by Afghan security forces.
However, the region’s council chief, Babur Eshchi, told the BBC the militants were now in control of the whole city, except an army base, where fighting was still going on.
The region’s deputy governor told AFP news agency that government officials had retreated to the airport.
Violence is also raging in other parts of the country, as the Taliban continue to make rapid advances, displacing thousands of civilians.
The city of Zaranj, in Nimroz province, was the first regional capital to fall to the insurgents on Friday.
Other provincial capitals under pressure include Herat in the west, and the southern cities of Kandahar and Lashkar Gah.
In the Afghan capital Kabul, the Taliban shot dead President Ashraf Ghani’s former spokesman and carried out a bomb attack on the house of the acting defence minister.
The Taliban have closed the border with Pakistan, and pictures show dozens of Afghans stranded on the Pakistani side, unable to return to their families.
“We came [to Pakistan] to attend a funeral three days ago. Now the border is closed. We’re sitting here. We have no food and no money,” a man trying to get home to Kandahar told Reuters news agency.
The Afghan military says dozens of Islamist fighters, including some senior commanders, have been killed in Lashkar Gah, however the Taliban have denied the military’s version of events.
The US and UK governments have urged its citizens to leave immediately because of the worsening security situation.
On Friday, the British Foreign Office warned that militants were very likely to carry out attacks in Afghanistan. The US has said citizens can receive a repatriation loan if they cannot afford to pay for a commercial flight themselves.