Mexicans have expressed incredulity at the appointment of a former prosecutor to the country’s top intelligence position, even though he once oversaw a notorious nine-day search for a missing girl who was eventually found lying dead in her own bed.

Alberto Bazbaz, a close ally of President Enrique Peña Nieto, was named on Thursday as the new head of Mexico’s intelligence agency, Cisen, at a time when the country’s authorities are struggling to contain violent crime.

Bazbaz previously led the finance ministry’s intelligence unit since shortly after Peña Nieto took office in December 2012.

But he is best known for overseeing the case of Paulette Gebara, a four-year-old who was reported missing from her family’s apartment in a Mexico City suburb in 2010.

Despite extensive searches and a media coverage, investigators found no trace of the girl for nine days, when her decomposing body was found in her own bed – even though the room had supposedly been sealed by police.

At the time, Peña Nieto was the governor of the state of Mexico, (which surrounds the national capital on three sides), and Bazbaz was the region’s attorney general.

Bazbaz resigned amid outrage over the bungled investigation, and a subsequent investigation concluded that Paulette died accidentally of asphyxiation.

Analysts say that during Bazbaz’s leadership of the financial intelligence unit, Mexico failed to make progress tracking down the fortunes of the country’s drug cartels.

His appointment to Cisen comes less than six months before presidential elections.

The switch in leadership at Cisen – which is part of the interior ministry – follows the resignation of the interior minister, Miguel Ángel Osorio Chong, who stepped aside on Wednesday to seek a senate seat. He left after an especially violent 2017 – which is set to be the country’s most murderous in recent memory.

Political observers said that Bazbaz’s appointment owed more to his links with Peña Nieto’s inner circle than his skills as a law enforcement official.

“The question here is not what is your area of expertise, but what [political] group do you belong to,” said Carlos Bravo Regidor, professor at the Centre for Teaching and Research in Economics. “If you have some relevant experience, that’s great, but it’s not a prerequisite for the job.”

