Attorney General Jeff Sessions asked all 46 US attorneys appointed by President Obama to resign Friday — but while Brooklyn’s Robert Capers was quick to comply, the future of the city’s only other Obama holdover, Manhattan’s Preet Bharara, remained unclear.

After meeting separately with Bharara in late November, both Sessions and President Trump said they planned to keep the aggressive Southern District AG in place.

“We had a good meeting,” Bharara told reporters after his meet with Trump. “I agreed to stay on. I have already spoken to Sen. Sessions . . . He also asked that I stay on, and so I expect that I will be continuing to work and so I expect that I will be continuing to work at the southern district.

Bharara has hardly been a paragon of fealty since then.

In starting his own personal Twitter account last week, Bharara identified himself as “a patriotic American and proud immigrant.”

But while sources in Bharara’s office described an atmosphere of surprise and uncertainty on Friday — with no word on a resignation — Capers resigned immediately.

“This afternoon, I was instructed to resign my position as United States Attorney for the Eastern District of New York, effective March 10, 2017, he said in a resignation statement.

“It has been my greatest honor to serve my country, New York City and the people of this district for almost 14 years, with the last 17 months serving as United States Attorney.”

In Session’s directive made no exceptions.

“As was the case in prior transitions, many of the United States Attorneys nominated by the previous administration already have left the Department of Justice. The Attorney General has now asked the remaining 46 presidentially appointed U.S. Attorneys to tender their resignations in order to ensure a uniform transition,” Department of Justice spokeswoman Sarah Isgur Flores said in a Friday afternoon statement.

“Until the new U.S. Attorneys are confirmed, the dedicated career prosecutors in our U.S. Attorney’s Offices will continue the great work of the Department in investigating, prosecuting, and deterring the most violent offenders,” she added.

The spokeswoman confirmed that Bharara was one of the 46 members asked to resign Friday.

During the presidential transition, then President-elect Trump met with Bharara to ask him to stay as the federal prosecutor in the Southern District of New York.

Capers said Bridget M. Rohde will continue the great work of this office as Acting United States Attorney.

Trump met with Bharara at Trump Tower to make the offer, which was readily accepted.

The White House declined to comment.

With Post wire services