MEXICO CITY (Reuters) - Twenty-seven of 31 suspected cartel members arrested this week in a Mexico City raid were freed by a judge, President Andres Manuel Lopez Obrador said on Friday, marking his government’s second high-profile failure to keep suspected criminals locked up in as many weeks.

FILE PHOTO: Mexico's President Andres Manuel Lopez Obrador holds his daily news conference in Oaxaca, Mexico October 18, 2019. REUTERS/Jorge Luis Plata

The suspects were nabbed by security forces in a central district of the capital on Tuesday after authorities seized two laboratories used to produce synthetic drugs, 50 kg (110 pounds) of chemical precursors, more than two tons of marijuana and 20 kg of cocaine, as well as an unspecified amount of money, rocket launchers and grenades.

Lopez Obrador, speaking at his regular morning press conference, said the unexpected release of the criminal suspects would be investigated but cautioned against a rush to judgment.

“Here the important thing is to see what the arguments were that were used to release these people,” said the leftist leader, who took office in December. “Let’s not rush. If someone acted improperly, illegally, if there was corruption, we will condemn it,” he said.

With homicides on track to hit an all-time high this year and following the bungled arrest last week of a notorious drug lord’s son, Lopez Obrador’s approach to security has come under increasing scrutiny.

Sinaloa Cartel gunmen on Oct. 17 overwhelmed security forces who had detained one of the sons of jailed drug kingpin Joaquin “El Chapo” Guzman in the northwestern city of Culiacan, forcing the release of the son and prompting a public outcry.

In his comments Friday, Lopez Obrador said police were under-trained and had been ineffective in putting together case files, and gathering all the evidence needed to keep suspected criminals behind bars.

“The case files are wrongly put together and this lets judges say ‘This is wrong, there isn’t enough evidence, there are contradictions’ and then they go free,” he said.

He did not elaborate, and the circumstances surrounding the release of the suspects believed to belong to the Tepito Union cartel, including the identity of the judge who handled their case and when they were allowed to walk free, were not immediately known.

A judicial reform, approved by Congress in 2008 and implemented in 2016 under the administration of Lopez Obrador’s predecessor, requires police to present more evidence for arrests.

The reform sought to modernize the judicial system by ending closed-doors trials and implementing public proceedings where prosecutors and defenders present evidence.

Lopez Obrador said security officials need to be “better trained” and that judges must be “honest, incorruptible.”