LIMA, Peru (AP) — Peru’s attorney general has resigned following accusations that he hindered a corruption probe involving Brazilian construction giant Odebrecht.

Pedro Chavarry sent a letter to Peru’s chief prosecutors Tuesday saying he was stepping down in order to preserve the autonomy of the Attorney General’s Office and stop the country’s president from intervening in other, independent branches of government.

On New Year’s eve, Chavarry dismissed two senior prosecutors who led a probe into whether several former presidents accepted money from Odebrecht. That sparked street protests in which demonstrators accused Chavarry of protecting corrupt officials and led President Martin Vizcarra to launch an attempt to remove Chavarry.

Odebrecht has admitted in U.S. court filings that it paid $800 million in bribes to officials across Latin America, including $29 million in Peru.