MEXICO CITY — Mexican authorities on Monday raised the death toll from an attack on a state prison in Ciudad Juarez across the border from El Paso, Texas to 17, a brazen operation that appeared designed to free the leader of a local gang.

Twenty-five inmates escaped in the attack.

Security Secretary Rosa Icela Rodríguez said 10 of the dead were prison guards who were attacked by gunmen who arrived early Sunday in armored vehicles and fired on the entrance and inside dormitories.

Rodríguez identified the inmates who escaped as being with the Mexicles gang, which she associated with the Caborca Cartel. She said the Mexicles’ leader was among the fugitives. The Mexicles have been one of Juarez’s main gangs for decades and for many years were known to work with the Sinaloa Cartel.

The Caborca Cartel had been led by drug lord Rafael Caro Quintero who was recaptured in July.

Defense Secretary Luis Cresencio Sandoval said the soldiers and state police who retook control of the prison found 10 “VIP” cells outfitted with televisions and other comforts. One even had a safe filled with cash.

Authorities also found cocaine, methamphetamine, heroin, fentanyl and marijuana inside the prison.

Sandoval said two other gunmen killed after attacking local police a short time before the attack on the prison were likely a diversion. They were not included in the 17 dead, which were made up of 10 guards and seven inmates.

In August, a riot inside the same state prison spread to the streets of Juarez in violence that left 11 people dead.

In that case, two inmates were killed inside the prison and then alleged gang members started shooting up the town, including killing four employees of a radio station who were doing a promotion at a restaurant.

Violence is frequent in Mexican prisons, including in some where authorities only maintain nominal control. Clashes regularly erupt among inmate of rival gangs, which in places like Juarez serve as proxies for drug cartels.