The attack, claimed by the Islamic State group (IS), began on Sunday evening when car bombs were detonated at the prison’s entrance by gunmen.
Eight of the attackers were killed in a battle lasting almost 20 hours, a Nangarhar province spokesman said.
As many as 300 inmates are believed to be still on the run.
There were 1,793 prisoners in the jail at the time of the attack – most of them Taliban and IS fighters, a security source told the AFP news agency. It was not immediately clear if the attack had been staged to free specific prisoners.
Those accused of general crimes were also held in the prison.
According to the provincial spokesman, 1,025 escaped prisoners have been brought back to the jail, and 430 have been rescued. More than 50 people were injured.
From BBC News