Ovidio Guzmán López was seized at a house on a judge’s warrant in the city of Culiacán, cartel gunmen fought street battles with security forces.
At least eight people were killed and 16 wounded, the authorities’ say, with vehicles left burning in the streets.
President Andres Manuel Lopez Obrador said the decision to cancel the arrest on Thursday had saved lives.
Senior security officials had decided on his release, the president said at a news conference. “The officials who took this decision did well,” he said.
“The capture of a criminal is not worth more than people’s lives.”
Witnesses described scenes of panic in the city, a stronghold of the Sinaloa cartel, as families with small children fled from gunfire.