Mexico's public prosecutor has blocked the release from jail of notorious drug lord Héctor Palma, hours after a judge ordered that he should be freed.
Palma, 63, founded the powerful Sinaloa cartel with Joaquín "El Chapo" Guzmán and has spent the past 28 years in jails in the US and in Mexico.
He pleaded guilty to drug trafficking in 2005.
However, a judge said on Tuesday there was not enough proof to hold him on separate charges of organised crime.
Palma's criminal career was portrayed in the Netflix series Narcos: Mexico.
Judge María Dolores Olarte ruled that the arguments presented by prosecutors linking Palma, who is widely known as "El Güero (Spanish for someone with fair skin or light-coloured eyes and hair), to organised crime were mostly "unfounded".
But following her ruling, the public prosecutor issued a new arrest warrant against Palma on charges of qualified homicide, requiring him to remain in prison, judicial sources told the BBC.
Palma was released once before two years ago, when he was acquitted of organised crime charges.
But he was rearrested within seconds after a judge annulled the acquittal, arguing that two witnesses who had accused him of two murders and links to drug smuggling should be tracked down so they could testify against him.
However, the prosecution has been unable to locate the two witnesses who had incriminated him, prompting Judge Olarte's decision to free Palma.
Palma is one of the most notorious drug lords of the 1980s and 90s.
He started his criminal career as a hitman for Miguel Ángel Félix Gallardo, one of the founders of the now-extinct Guadalajara drug cartel.
When Miguel Ángel Félix Gallardo was arrested in 1989, his criminal empire split into two, one controlled by his nephews, the Arellano Félix brothers, with its power base in the city of Tijuana, and another controlled by Palma and Joaquín "El Chapo" Guzmán, based in Sinaloa state.
The two splinter groups soon started competing with each other and Palma was accused of having "betrayed" Felix Gallardo by keeping the proceeds from a drug shipment for himself.
It was about this time that Palma became involved in one of the most gruesome and infamous vendettas to engulf Mexico's criminal underworld.
A Venezuelan man, Rafael Clavel Moreno, seduced Palma's wife, Guadalupe Leija, convincing her to leave her husband and move to the United States along with the two children she had had with Palma.
Once they had arrived in San Francisco, Clavel Moreno killed Palma's wife and reportedly sent her decapitated head to Palma.
Clavel Moreno then took the two children, aged four and five, with him to Venezuela, where he killed them by throwing them off a bridge.
Palma then took revenge by having Clavel Moreno's family killed, as well as a number of relatives and close associates of Miguel Ángel Félix Gallardo.
Clavel Moreno, who had been arrested for the murder of the two children, was killed in jail.
There are conflicting reports as to who had hired Clavel Moreno, with some pointing the finger at Miguel Ángel Félix Gallardo directly and others blaming the jailed drug lord's nephews.
Palma built his wife and children a lavish pantheon in a cemetery in Culiacán used by members of the Sinaloa cartel as a resting place for their relatives.
He was arrested in 1995 shortly after the private jet he was travelling in crashed. His lavish golden pistol drew the attention of police when they questioned the injured Palma at the home where he was convalescing.
Palma was extradited to the US in 2007 and handed back to the Mexican authorities in 2016 after serving his drug-trafficking sentence.