MEXICO CITY — Parents hugged their children behind locked doors of nurseries while gunshots rang out on the streets. Men with Kalashnikovs and burning trucks blocked key roads and access to the airport. Fifty-one inmates including murderers and kidnappers broke out of jail. To avoid more bloodshed, the Mexican government ordered the release of Ovidio Guzmán López — son of the convicted drug kingpin Joaquin Guzmán, known as El Chapo — who had been indicted in the United States for drug trafficking and captured by Mexican government forces. Cartel gunmen had taken to the streets in response to Mr. Guzmán’s arrest.

As these events unfolded in the city of Culiacán in the state of Sinaloa on Thursday, they were broadcast live on TV and social media, raising fears about a failure in the security strategy of President Andrés Manuel López Obrador. Some people were relieved the official death toll that night was only eight, although several more corpses were found on Friday. But the Sinaloa cartel won, the government capitulated to its terror, and gangsters continue to have a level of control in swaths of the country.

On Friday, President López Obrador defended the decision to give in to the cartel’s demand to release Mr. Guzmán, saying it avoided a massacre. “You can’t fight fire with fire … We don’t want deaths. We don’t want war,” he said. “With justice, we will guarantee peace and tranquillity in the country.” The problem is that his government is absolutely not guaranteeing peace and tranquillity, and violence rages daily.

The call to set Mr. Guzmán free in the midst of the fighting was a tough decision. Cartel thugs even attacked a military family unit, putting the lives of officers’ children at stake. Other soldiers were reportedly held at gunpoint. There is a valid debate about the proper response to a hostage situation.