An unknown number of gunmen aboard armored vehicles took part in the attack, and the dead included 10 prison guards and security agents, the office said in a statement.
About five hours after the dawn incursion began, security forces managed to control the situation, which had also erupted into fighting between inmates within the sprawling state prison, near Mexico’s border with the United States.
Moments before the attack, armed men fired on municipal police along a nearby boulevard, setting off a car chase that ended with the seizure of a vehicle and four men, the statement added.
Later, assailants in a Hummer fired on another group of security agents outside the prison, it said.
Scenes of chaos ensued as relatives of some prisoners waited for New Year’s visits outside the compound.
Inside, some rioting inmates set fire to various objects and clashed with prison guards, local media reported.
Prosecutors said the outbreak of violence at the prison, where inmates from differing criminal bands and drug cartels are housed in separate cell blocks, also left 13 people injured.
Four people were detained, prosecutors said, without specifying if they were inmates or armed assailants.
Details were not immediately available about how the 24 inmates were able to flee or who they were.
History of violent clashes
Prosecutors in the city, which sits across the border from El Paso, Texas, said they were investigating the motive of the attack.
Ciudad Juarez has been the scene of years of violent clashes between security forces and the rival Sinaloa and Juarez drug cartels, which have left thousands dead over the past decade.
The prison itself has seen multiple breakouts of fighting and riots, including a bloody March 2009 episode that left 20 dead.
In August 2022, a clash between rival gangs left three prisoners dead.
According to a February 2022 report by the State Human Rights Commission, more than 3,700 people are detained in the prison, above its maximum capacity of 3,135.
In February 2016, as part of his visit to Mexico, Pope Francis officiated mass in the state prison’s courtyard with 700 prisoners and their families in attendance.
Mexican detention centers, particularly those run by the state, suffer from chronic overcrowding and violence, which has worsened in recent years due to conflict between criminal groups.