Mexico's president has defended freeing drug kingpin Joaquín "El Chapo" Guzmán's son soon after his arrest.
When 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 reportedly killed and 21 wounded, with vehicles left burning in the streets.
President Andres Manuel Lopez Obrador said the decision to cancel the arrest 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.
As the gun battles raged, a lawyer for the Guzmán family told the Associated Press, "Ovidio is alive and free."
Image caption: Former head of the Sinaloa Cartel, Joaquín "El Chapo" Guzmán
Mr López Obrador was elected on a platform of cracking down on Mexico's drug cartels, and has tasked the National Guard, a new security force, with fighting the dealers.
Under El Chapo's leadership, the Sinaloa cartel was the biggest supplier of drugs to the US, officials say.
The kingpin was jailed earlier this year, and Ovidio Guzmán Lopez is one of several brothers with a hand in running the cartel.
Thought to be in his twenties, he is accused of drug trafficking in the US.
What happened in Culiacán?
A patrol of National Guard militarised police came under intense fire from a house, Security Minister Alfonso Durazo said.
The security forces fought back and found Mr Guzmán, but were then surrounded by gunmen and forced to retreat.
Defence Minister Luis Cresencio Sandoval told reporters the operation had been "badly planned". A National Guard policeman was among the dead, he said.
Fighters also attacked security forces in other parts of Culiacán and bodies were seen on the streets.
Witnesses described scenes of panic in the city, a stronghold of the Sinaloa cartel, as families with small children fled from gunfire.
Image copyright: REUTERS
Image caption: Trucks were set alight in the streets to block roads
Footage on social media showed a pick-up truck with a machine gun mounted on the back, in scenes reminiscent of a war zone.
Image copyright: AFP/GETTY IMAGES
Image caption: Armed men were seen in several areas of Culiacán on Thursday
Image copyright: EPA
Image caption: The Sinaloa state government told residents to remain calm and stay off the streets
Other footage showed families scrambling to take cover under cars and in shops as bullets flew. In one video, a girl asked her father: "Why are they shooting bullets?"
A purported mugshot taken of Mr Guzmán while he was detained by police was shared widely on social media.
Image copyright: REUTERS
Image copyright: EPA
As fighting brought the city to a standstill, the Sinaloa state government said an unknown number of inmates had escaped from the Aguaruto prison.
It said it was "working to restore calm and order" and called on residents to "remain calm, stay off the streets and be very attentive to official advisories on the evolving situation".
What was El Chapo's role in Mexico's drug trade?
"El Chapo" (or "Shorty") ran the Sinaloa cartel across northern Mexico.
Over time, it became one of the biggest traffickers of drugs to the US. El Chapo escaped a Mexican jail through a tunnel in 2015, but was later arrested. He was extradited to the United States in 2017.
He was accused of having helped export hundreds of tonnes of cocaine into the US and of conspiring to manufacture and distribute heroin, methamphetamine and marijuana.
El Chapo, 62, was found guilty in New York of 10 charges, including drug trafficking and money laundering.
Who are 'El Chapo's' children?
Guzmán has been married three times. Estimates of the number of offspring, from wives and girlfriends, vary from eight to 15.
Ovidio Guzmán López is thought to be one of four children born to the drug kingpin's second wife, Griselda Lopez Perez.
More prominent are his older brothers by Guzmán's first marriage to Maria Alejandrina Salazar Hernandez - Ivan Archivaldo Guzman Salazar and Jesus Alfredo Guzman Salazar, both 36.
Ivan Archivaldo has developed a reputation for an extravagant lifestyle and flaunting his wealth on social media.
Image copyright: TWITTER
The jailing of "El Chapo" threw up the question of who should now lead the Sinaloa cartel.
There are reports of infighting between some of the Guzman sons, known as "los chapitos", and the co-founder of the Sinaloa cartel, Ismael "El Mayo" Zambada.
Zambada has been trying to oust the sons, VICE news reported in July, quoting sources in the mountains of Sinaloa state. Gunmen are said to have been defecting to work for Zambada.
Jesus Alfredo is wanted in the US on allegations of drug-trafficking and is on the most-wanted list of US Drug Enforcement Administration.
Ivan Archivaldo has also been charged by the US authorities.
Story and Images courtesy BBC NEWS