President Donald Trump said Friday in a social media post that Ed Martin is leaving his role as the Justice Department's pardon attorney to "fight Legal Battles" surrounding this year's midterm elections and the 2028 presidential election. This was reported by Qazaqyia.kz citing Associated Press.

Trump wrote that Martin will "do an outstanding job, ensure Free, Fair, and Honest Elections, and strongly advance our Constitutional Rights."

Martin has been a controversial figure in the Trump administration since his appointment last year as interim U.S. attorney for the District of Columbia, where he oversaw the dismissal of Jan. 6 cases after Trump's sweeping pardons. Trump later pulled Martin's nomination for the job over bipartisan concerns about his lack of prosecutorial experience and support for rioters who violently attacked the Capitol.

He then moved to Justice Department headquarters as pardon attorney and director of a group tasked with scrutinizing actions by President Joe Biden's administration that Republicans say unfairly targeted conservatives. Then-Attorney General Pam Bondi also named him a special attorney to help conduct mortgage fraud investigations into Democratic Sen. Adam Schiff and New York Attorney General Letitia James.

He often raised eyebrows during his tenure. In one instance, while conducting his mortgage fraud investigation into James, he sent her a letter urging her to resign from office "as an act of good faith." He also posed for photos outside her Brooklyn home.

The Justice Department's case against James was dismissed after the judge found that another prosecutor who brought the charges was illegally appointed.

Martin was later sidelined amid clashes with Justice Department leadership and was removed as head of the "Weaponization Working Group," though he kept his title as pardon attorney.

In a social media post Friday, Attorney General Todd Blanche called Martin a "patriot who loves this nation." Martin didn't immediately respond to a message Friday.