US President Donald Trump has removed Attorney General Pam Bondi - a longtime ally and fierce defender of his administration - from her post as America's top law enforcement officer.

Trump praised her in a post on Truth Social and said she would be transitioning to a role in the private sector.

Bondi's time leading the justice department was often overshadowed by its handling of the release of files relating to Jeffrey Epstein and its investigation into the convicted sex offender.

She is the second Trump administration official in recent weeks to be cut from her post, after Kristi Noem was ousted as homeland security chief in March. Bondi will be replaced by her former deputy, Todd Blanche.

Blanche denied US media reports that Bondi's handling of the Epstein files had been a factor in Trump's thinking.

As President Trump said today, the attorney general made our country safe again, and she is a friend and did a great job in the first year of this administration, he told Fox News on Thursday evening.

Bondi said she would be working tirelessly to transfer her work to Blanche, adding that the job had been the honour of a lifetime.

She added that in her new private sector position - which she did not identify - she would continue fighting for President Trump and this administration.

The announcement comes less than two months after a combative congressional hearing in which Bondi was peppered with questions from lawmakers - at times descending into shouting matches in which she called one Democrat a washed-up loser.

As recently as Thursday morning, Trump was defending Bondi, saying: She is a wonderful person and she is doing a good job. But hours later, Trump confirmed her departure on Truth Social, saying that her new private sector role would be announced at a date in the near future.

Trump lauded Bondi's performance as attorney general in his post, saying she had done a tremendous job overseeing a massive crackdown in crime across our country.

However, the president had reportedly grown increasingly frustrated with Bondi, in particular over her handling of the Epstein files. This had led to Trump's support eroding over a period of months and to increasing displays of frustration with Bondi in private, according to two sources who spoke to the BBC's US partner CBS News.

In the end, millions of files related to Epstein were released under pressure - including from Trump supporters - and only after Congress passed a law requiring the Department of Justice to make unclassified records public.

Survivors also told the BBC that Bondi had yet to meet them or respond to their emails about Epstein's wrongdoing, and that the matter had become a political liability for Trump. Bondi has called Epstein a monster and told the victims she was sorry for the abuse they endured.

According to sources, Bondi's office faced bipartisan backlash over its handling of the Epstein investigation, with lawmakers accusing the justice department of failing to obscure some identifying information about survivors while protecting the identities of those who were not victims.

With Trump's announcement, Bondi becomes the third high-profile member of Trump's cabinet to leave this term, following former Homeland Security Chief Kristi Noem and National Security Adviser Mike Waltz.