(CNN) -- Officials in Ciudad Juarez are looking for the perpetrators of a prison massacre, as details emerge about the late Monday incident that left 17 inmates dead.
Authorities in the city have opened an investigation into the episode. Forty-four prison guards have been questioned as part of the investigation, according to Jorge Gonzalez Nicolas, the northern district chief for the Chihuahua state attorney's office, adding that 406 inmates have undergone gun-powder residue tests to determine if they were involved in the shootings.
Most of the victims were gang members who were attacked by rivals at the state prison in the border city of Ciudad Juarez, Gonzalez said.
He described the deaths of the inmates as "an execution."
Authorities released a prison surveillance video that shows two men with their faces covered. They appear to force an unarmed prison guard to give them the keys to a holding cell as another unarmed guard stands by. The men use the keys to open at least two metal doors, allowing access to four men carrying guns, who also have their faces covered.
The video shows the armed men shooting into the holding cell with automatic weapons, but the camera angle doesn't reveal what happened inside.
Both the shooters and the victims were inmates, according to Gonzalez.
"This shooting makes it evident that there's corruption and serious lack of security at the prison," Gonzalez said. "Somehow a group of prisoners came all the way from yard No. 3 to this holding area, took the cell keys from the guards and executed 13 people."
Four other bodies appeared elsewhere inside the prison, according to Gonzalez.
The armed inmates tried to escape after the shooting, Gonzalez said. Federal, state and municipal police forces intercepted the inmates, who were trying to reach a tunnel that connects the prison to an adjacent courthouse. But the inmates ran back into the prison, got rid of their weapons and dispersed among other prisoners, he said.
Authorities said they have recovered six weapons: two Uzis, one AK-47 assault rifle and three 9mm automatic handguns.
Gonzalez says what happened at the prison is not surprising.
"Historically, this CERESO (a Spanish acronym for Mexican state prisons) has been a place where drug lords have planned executions and human trafficking occurring outside the prison," he said. "The fact that inmates inside the prison were able to perpetrate this massacre speaks of the level of corruption we're dealing with, but we're working diligently to change the situation."
The top prosecutor said authorities also are investigating whether a party was held at the prison the night before the shootings in which there were drugs, alcohol and as many as 20 prostitutes, including several minors. Some of the inmates attending the party, Gonzalez said, where the victims of the massacre.
The police chief of Ciudad Juarez, Julian Leyzaola, was at the prison where the deadly incident occurred when he was fired on by federal officers earlier this week. The country's National Security Ministry said Wednesday that Leyzaola "acted outside of the protocol" when he breached a security perimeter and drove by a checkpoint without stopping.
Leyzaola took on the job of Ciudad Juarez' top cop in March. He has confidently predicted that the city will be pacified and public confidence will return by 2012. He has fired more 150 police officers and been the target of death threats by drug cartels.
But he also acknowledges a rift between local and federal police. Coordination between the two "doesn't exist," he told CNN in an exclusive interview earlier this year. "There is no coordination. They do their work on their side, and we do it on ours."
On Tuesday, the mayor of the embattled border city said that federal police will begin pulling out of Ciudad Juarez in September. Mayor Hector Murguia said an assessment indicated that the city's security situation is under control and that local police are in a position to take over control of security.
More than 8,000 federal police arrived in Ciudad Juarez in March 2008. They were part of Joint Operation Chihuahua, the federal government's strategic plan to curtail escalating violence in the city, submitted by Mexican President Felipe Calderon.