NATO's International Security Assistance Force, which is separate from the US-led coalition, said more than 1,100 prisoners had escaped.
Afghan deputy justice minister Mohammad Qasim Hashimzai said the attack was the most sophisticated yet by the militants, who were removed from government in late 2001 in a US-led invasion.
A Taliban spokesman, Yousuf Ahmadi, said the rebels had used suicide bombs and detonated a bomb-laden water tanker in the attack.
Amir Mohammad Jamshid, the head of prisons at the ministry of justice, said some "important Taliban" were among those who escaped.
Despite the presence of about 70,000 international troops mainly operating under NATO, the insurgency aimed at toppling the US-backed government in Kabul has gained pace in the past two years.