A statement from US forces in Afghanistan today sid special forces from the two countries carried out a helicopter assault on the prison in Nawzad district last night.
The statement says the operation freed 40 prisoners, who were captured Afghan police, army and border police.
The Afghan defence ministry says 60 prisoners were rescued. The discrepancy in the number of prisoners freed could not immediately be explained.
The ministry said the original aim of the operation was to arrest a Taliban commander.