FILE PHOTO: El Salvador's Attorney General Douglas Melendez is interviewed by Reuters in San Salvador, El Salvador October 10, 2018. REUTERS/Jose Cabezas

SAN SALVADOR (Reuters) - El Salvador’s legislative assembly on Friday denied Attorney General Douglas Melendez a second term, after he pursued tough anti-corruption investigations and put a former president in prison.

In less than three years, career prosecutor Melendez also jailed his predecessor, a judge and a top businessman, among others, and faced death threats for his work.

But after several days of backroom negotiations, El Salvador’s main political parties decided not to reinstate him.

They instead chose Raul Melara, a doctor of law who ran the conservative National Association of Private Enterprise (ANEP) and was a substitute Supreme Court judge.

Melara was proposed by right-wing party ARENA, and will run the attorney general’s office from January 2019 for three years.

Outgoing Melendez’s team prosecuted former President Antonio Saca, who is now serving 10 years in prison for embezzlement and money laundering, and is trying to extradite Mauricio Funes, who was president until 2014, from Nicaragua.

Melendez has powerful critics from the country’s left, who said he was tougher on their politicians. Melendez says both the left and right accused him of bias.

The attorney general’s office declined to comment.