Mexico's Attorney General, Arturo Chavez, has resigned, President Felipe Calderon has confirmed.
Mr Chavez had been leading efforts to tackle Mexico's violent drugs cartels and reform the justice system for 18 months.
He said he was leaving for urgent personal reasons.
Mr Chavez is to be replaced by investigative prosecutor Marisela Morales, who will be Mexico's first female attorney general.
President Calderon thanked Mr Chavez for his service, saying he had helped bring many cartel leaders to justice.
"His work has been fundamental to Mexico's efforts to establish the rule of law and guarantee security," he said.
The appointment of Marisela Morales must still be approved by the senate.
President Calderon said her mission would be "to deepen the strategic role of the attorney general's office, in particular in the fight against organised crime".
Earlier this month Ms Morales, 41, was given a bravery award by the US government for her role in the fight against drug trafficking.
The resignation of Arturo Chavez comes three weeks after the whistle-blowing website Wikileaks released a US diplomatic cable describing his appointment in 2009 as "totally unexpected and inexplicable".
In his previous role as the top prosecutor in Chihuahua state, he was accused of mishandling investigations into the murder of women in Ciudad Juarez on the US border.
He is the second attorney general to resign since President Calderon began deploying the army to fight drug-trafficking gangs in 2006.
Around 35,000 people have since been killed in drug-related violence.