Criminal gangs have forced the chief of police in Mexico's most violent city, Ciudad Juarez, to step down.
Roberto Orduna stepped down hours after a policeman and a prison guard were killed in the city, which has been wracked by drug-related violence.
Gangs had threatened to kill at least one police officer every two days until Mr Orduna quit.
Murders are frequent in Ciudad Juarez, which sits on the US border and is a key staging post on the drug route.
Mayor Jose Reyes had insisted the city would not back down to criminal gangs.
But speaking after the two murders, he said Mr Orduna's departure was the only way the authorities could protect policemen.
"These events took place despite the measures that we took to protect the municipal policemen. That is the reason why the decision was taken," Mr Reyes said.
Mr Orduna said he did not want to endanger any more lives after a spate of shootings this week.
The resignation was the latest evidence that drug gangs exercise formidable control over parts of northern Mexico, says the BBC's Stephen Gibbs in Mexico City.
Recent widespread anti-army protests in the region appear to have been largely orchestrated by the cartels.
The Mexican government has vowed to take on the drugs gangs, and some 40,000 troops have been deployed across Mexico since 2006 to battle cartels which make billions of dollars a year exporting cocaine and other drugs to the US.
While this campaign has resulted in record drug seizures, it has also provoked a dramatic escalation in violence, as the gangs fight both one another and the federal forces.