Heavy fighting broke out in northern Mexico after the security forces seized one of the sons of jailed drug kingpin Joaquín "El Chapo" Guzmán.
Fighting raged for several hours after Ovidio Guzmán López was found during a routine patrol in the city of Culiacán.
Footage showed heavily-armed men firing on police, with cars, bodies and burning barricades strewn in the road.
Police withdrew without Mr Guzmán in their custody to avoid further violence, officials said.
Mexico's security minister, Alfonso Durazo, told Reuters news agency that a patrol of National Guard militarised police came under intense fire from outside the house where they had located Mr Guzmán, forcing them to retreat from the building for their own safety and "to recover calm in the city".
A lawyer for the Guzmán family told the Associated Press (AP): "Ovidio is alive and free."
Mexico's President Andrés Manuel López Obrador said he would hold a meeting of his security cabinet to discuss the incident.
The state government said Mr Guzmán was found in a house by a police patrol on a routine search.
It said cartel members subsequently launched the huge attack in an attempt to seize him back from the authorities. Fighters also attacked security forces in other parts of Culiacán.
Witnesses described scenes of panic in the city, a stronghold for the Sinaloa cartel, as families with small children fled from gunfire.