MEXICO CITY (Reuters) - Mexico’s top prosecutor for electoral crimes on Friday said he would no longer fight his dismissal by the acting attorney general, ending a simmering dispute that had caused embarrassment to the government of President Enrique Pena Nieto.

Mexico’s acting attorney general last week fired Santiago Nieto on the grounds that he broke a code of conduct for officials. Nieto’s firing came just days after he spoke publicly about a graft investigation linked to the campaign of Mexican President Enrique Pena Nieto.

His summary dismissal stirred up a major row in Congress that at one point threatened to impede the passage of legislation, but with the passing of a key budget bill late on Thursday, there were signs the dispute was receding.

In a letter to the Senate and a news conference, Nieto said that he had become too polarizing a figure to keep working ahead of national elections next year. However, he insisted he had broken no law and that he had been unfairly dismissed.

“For all these reasons I have decided to withdraw my objection to (my dismissal),” he said in the letter.

Nieto was fired after an interview with newspaper Reforma in which he said Emilio Lozoya, the former boss of state oil firm Pemex, wrote to him to ask that he be declared innocent of accusations he funneled cash from Brazilian construction firm Odebrecht into Pena Nieto’s 2012 election campaign.

Lozoya, who was a senior adviser to Pena Nieto in the campaign, denies the allegations about Odebrecht. The firm is at the heart of a bribery and kickback probe, known as Lava Jato or Car Wash, that has reverberated across Latin America.

Pena Nieto has also denied involvement in any wrongdoing related to the 2012 campaign.