MEXICO CITY (Reuters) - Mexico’s Senate on Friday named the country’s new top prosecutor for election-related crimes, after the official previously in the post was fired amid a graft scandal involving a close former aide of President Enrique Pena Nieto.

Hector Marcos Diaz, a lawyer and academic with a long career in Mexico’s electoral bodies, was approved as the newest prosecutor for electoral crimes with 92 senators’ votes, the Senate said in a statement.

The previous incumbent, Santiago Nieto, was fired by Mexico’s acting attorney general in October on the grounds that he broke a code of conduct for officials.

Nieto had given a newspaper interview in which he accused Emilio Lozoya, the former boss of state oil firm Pemex and a senior member of the president’s 2012 campaign team, of writing to him to ask that he be declared innocent of funneling cash from Brazilian construction firm Odebrecht into Pena Nieto’s campaign.

Odebrecht is at the heart of a Brazilian bribery and kickback probe, known as Lava Jato or Car Wash, that has reverberated across Latin America.

The ruling Institutional Revolutionary Party (PRI) has been trying to shake a reputation for graft that threatens to undermine the party’s efforts to stay in power in next July’s presidential election. The firing of Nieto was widely seen as a setback to those efforts.

The PRI has overseen the arrest of various former state governors, but Lozoya poses a more difficult challenge, given his proximity to the president.

Both Pena Nieto and Lozoya have denied involvement in any wrongdoing related to the 2012 campaign.