The Justice Department in Washington in May 2013. (J. David Ake/AP)
Contributing columnist

Pity the poor Justice Department lawyer who draws the short straw these days.

On Wednesday, only 24 hours after assuring a federal district judge that the government would not try to add to the 2020 Census the citizenship question the Supreme Court had blocked, the department suddenly reversed ground.

That left it to a sheepish and bewildered career Justice Department lawyer, Joshua Gardner, to tell Judge George M. Hazel of the U.S. District Court for the District of Maryland that he was backing away from firm representations he had made to the court on behalf of the federal government just a day earlier.

The sole provocation for this humiliating situation: a tweet from President Trump on Wednesday morning asserting “we are absolutely moving forward” on the citizenship question,” notwithstanding the Supreme Court’s decision.

You read that right: a tweet. Nothing more.

Gardner had no choice but to inform the court, “The tweet this morning was the first I had heard of the president’s position on this issue. . . . As you can imagine, I am doing my absolute best to figure out what’s going on."

And, in short order, Gardner found himself backpedaling and doing his best to defend his own credibility, pleading to the court that, “I’ve been with the United States Department of Justice for 16 years through multiple administrations, and I’ve always endeavored to be as candid as possible with the court."

Translation: I’m a career employee and not a Trump toady; I recognize that the department looks lawless and untrustworthy right now, but please try not to hold it too much against us going forward.

Career Justice Department lawyers are used to working in anonymity and with the winds of their credibility and that of the department as a whole at their backs. This is very far from the way Gardner would like to have seen his name in the national news.

Likewise for Sarah Fabian, the career lawyer forced to the front lines to draw the fire of the U.S. Court of Appeals for the 9th Circuit — and public humiliation — for defending the proposition that denying immigrants soap and toothbrushes complies with the statutory mandate of “sanitary” detention facilities.

The fault here — beyond the obvious erratic lurching of the president and his l’etat-c’est-moi disregard of the rule of law — rests with Justice Department leadership.

Administrations change positions. That is understood and legitimate. But they do it with care, circumspection and due regard for the need to respect the law as objective and continuous, and for their duty of candor to the courts.

So the true eyebrow-raising feature of the department’s abrupt U-turn on the census is its absence of deliberation. The assistant attorney general for the civil division, Jody Hunt, who joined the conference before the court, conceded that the tweet was the sole impetus for the reversal.

That demonstrates an undue, if not ridiculous, solicitude for the whims of the mad king. The indication that Trump wanted to find a way around the ruling of the Supreme Court should have been (at most) a trigger for a reasoned process involving department leadership — in particular, the solicitor general, the client (in this case, the Commerce Department) and, perhaps, the White House counsel.

And voices within those discussions needed to be ready push back against political caprice, or measure it against the government’s longer-term responsibility to safeguard its credibility with the court and display fidelity to the rule of law. That is ultimately a service to the president, as well as to the department and the courts.

Yes, time is very short, but there is no indication of any such process having taken place here. Trump tweets; the department disposes.

The backwards somersault was all the more ill-considered given the severe credibility problems that the department and administration have created in this very case. The Supreme Court’s decision took the very unusual step of essentially rejecting as pretextual the proffered reason for including the citizenship question. Even before that, Hazel had taken the unusual step of reopening the case based on new evidence suggesting that the true reason for the question was to increase the political power of Republicans and non-Hispanic whites.

Finally, the solicitor general had made repeated representations to the Supreme Court that June 30 was a drop-dead date after which the census question could not be added. Now that the administration seems to believe otherwise, it leaves him with egg on his face.

The department seems relatively indifferent to the institutional cost of defending the imperial presidency, including the potential erosion in public confidence that the government is constrained by law. But this latest episode is a new indication that the federal courts at least are taking notice. The 9th Circuit on Wednesday handed the administration its latest setback, rejecting its request to stay a District Court ruling blocking the diversion of military funds to pay for Trump’s border wall.

If the department continues to jump at the president’s every hiccup — candor and consistency be damned — it may find that the courts are more likely to deny it the traditional benefit of the doubt and reject its litigating positions. That is more than an embarrassment for the front-line lawyers; it is a body blow to the department’s institutional interests and, potentially, the public’s confidence in a government of laws, not of men.

Read more:

The Post’s View: It’s time for Trump to surrender in his quest to warp the census

Paul Waldman: Trump’s efforts to rig the census may already be working

Jennifer Rubin: Census: A flat-out win for progressives, the courts and America

The Post’s View: It’s official: Trump fibbed on the census. Now he should just give it up.

Chris Dick: The 2020 Census is still at risk