The attorney general, Jeff Sessions, has asked for the resignations of 46 US attorneys who were appointed during the prior presidential administration, the justice department said on Friday.

Many of the federal prosecutors who were nominated by Barack Obama have already left their positions, but the nearly four dozen who stayed on in the first weeks of the Trump administration have been asked to leave “in order to ensure a uniform transition”, a justice department spokeswoman, Sarah Isgur Flores, said.

“Until the new US attorneys are confirmed, the dedicated career prosecutors in our US attorney’s offices will continue the great work of the department in investigating, prosecuting and deterring the most violent offenders,” she said in a statement.

The dismissal includes Preet Bharara, the top federal prosecutor in Manhattan who had been asked by Trump to stay on in November. Bharara had a name for himself in pursuing New York politicians in corruption cases as well as Wall Street executives accused of wrongdoing.

After his meeting in late November, the Obama appointee told reporters,“We had a good meeting. I said I would absolutely consider staying on. I agreed to stay on.” Bharara’s office is currently probing top New York Democrats in investigations linked to both governor Andrew Cuomo and Mayor Bill DeBlasio.

Only two prosecutors were held over. Dana Boente, the US attorney for the Eastern District of Virginia and acting deputy attorney general, and Rod Rosenstein, the US attorney for Maryland who been nominated to fill the role of deputy to Sessions. Rosenstein was appointed by Bush and held his post throughout the Obama administration.

“The president called Dana Boente and Rod Rosenstein tonight to inform them that he has declined to accept their resignation, and they will remain in their current positions,” spokesman Peter Carr said in a statement.

It is customary, though not automatic, for the country’s 93 US attorneys to leave their positions once a new president is in office. The Obama administration allowed political appointees of President George W Bush to serve until their replacements had been nominated and confirmed.

Federal prosecutors are nominated by the president, generally upon the recommendation of a home-state senator.

US. attorneys are responsible for prosecuting federal crimes in the territories they oversee. They report to justice department leadership in Washington, and their priorities are expected to be in line with those of the attorney general.

In a statement, Senator Dianne Feinstein of California, the ranking Democrat on the Senate Judiciary Committee expressed her concern about the mass firing.

“I’m surprised to hear that President Trump and Attorney General Sessions have abruptly fired all 46 remaining US attorneys,” she said. “In January, I met with Vice-President Pence and White House Counsel Donald McGahn and asked specifically whether all US attorneys would be fired at once.

“Mr McGahn told me that the transition would be done in an orderly fashion to preserve continuity. Clearly this is not the case. I’m very concerned about the effect of this sudden and unexpected decision on federal law enforcement.”

• The Associated Press contributed to this report.