Just hours after the polls closed in the US midterm elections, President Donald Trump very quietly made a very significant decision. He asked his attorney-general, Jeff Sessions, to resign.

This may seem like just another drama in the confusing personal politics of Mr Trump's presidency, but it is much more than that. It is devious and dangerous. It is an escalation of his attempt to expand his presidential power, remove any obstacles in his way and act as though he is above the law.

This is because the forced ouster of Jeff Sessions is not just about Mr Sessions himself, it's about the investigation led by Robert Mueller into potential collusion between Russia and the Trump campaign in the 2016 election.

While Mr Sessions was the original Trump loyalist — he was the first sitting politician to endorse him — Mr Trump has never forgiven him for recusing himself from the Russia investigation, and in so doing leaving the President vulnerable to investigative forces.

Mr Trump bided his time. He waited until just hours after the polls closed in the midterm elections earlier this month. Once all the ballots had been cast, Mr Trump asked for Mr Sessions' resignation.

These were the hours in which his political accountability was the weakest: the electorate will not go to the polls again until November 2020. Mr Trump made his move the earliest he possibly could while avoiding any immediate political accountability.

Politically, the move was cynical and concerning. But legally, it is alarming: by firing Mr Sessions, Mr Trump has given himself the power to appoint a new attorney-general to oversee the Russia investigation.

US Acting Attorney-General Matthew Whitaker can hold the job for 210 days without confirmation. ( AP: Charlie Neibergall, file )

Another loyalist steps up

Mr Trump appointed Matthew Whitaker. As Mr Sessions' chief-of-staff, Mr Whitaker has done the administration's bidding for much of Mr Trump's term so far. It's easy to imagine that will continue.

The US Constitution mandates that every cabinet position must be confirmed by the Senate, however Mr Trump cleverly took advantage of a legal loophole that allows a person to hold the office of "acting" cabinet member for 210 days — that's seven full months.

Mr Whitaker has been appointed Acting Attorney-General with no oversight and no congressional approval. Not even a job interview. And he is legally entitled to hold that office until mid-2019, during which time he could easily slow down or entirely defund the Russia investigation.

This sent a shockwave through those in Congress and in the public who understood what this could mean: that Mr Trump had found a way to obstruct justice in respect of an investigation about whether or not he obstructed justice. This is chilling, but somehow legal.

Or perhaps not: on Monday a group of Senate Democrats filed a suit in a DC Federal Court challenging Mr Trump's appointment of Mr Whitaker as Acting Attorney-General.

Sorry, this video has expired Jeff Sessions received a round of applause as he left the Justice Department for the last time

The law isn't used how it was envisioned

The senators argue that the law, which grants Mr Trump the power to appointment an acting attorney-general — called the Vacancies Reform Act — did not envision its provisions being used to install an acting cabinet member who had never been confirmed by the Senate for any federal office. Mr Whitaker, having only served as Mr Sessions' chief-of-staff, has never received Senate confirmation to serve in the US government.

The plaintiff senators argue that it is implied in the law that such a high-ranking cabinet member — a "principal officer" of the US government — would be chosen from the group of people who had already been confirmed for other senior government positions.

The law they rely on to make this argument is the Constitution itself, which expressly states that Congress must have an "advice and consent role" in the appointment of any principal officers of the federal government. They argue that Mr Trump's moves endanger the separation of powers established by the Constitution to ensure checks and balances exist to constrain each branch of government.

Senator Blumenthal said: "Whitaker would never pass the advice and consent test. In selecting a so-called 'constitutional nobody' and thwarting every senator's constitutional duty, Mr Trump leaves us no choice but to seek recourse through the courts."

He is right. The use of what appears to be a purely pragmatic law to subvert the rule of law in a very substantive way does, to my mind, offend the constitutional separation of powers.

We're further down the rabbit hole

This is a scenario in which a minor procedural provision on the statute books is being used for politically dangerous purposes. it's unlikely that the those who passed this legislation ever imagined a situation in which a power-hungry president fired his own attorney-general in order to halt a criminal investigation against him.

We are, I would say, much further down this particular rabbit hole than the authors of this law ever envisioned.

If Mr Trump's plan to keep Mr Whitaker as acting attorney-general for 210 days works, it could be the precise means by which Mr Trump gets rid of the Russia investigation once and for all. And fundamentally — constitutionally — we should not accept a system in which a president charged with criminal offences can use his presidential power to eliminate the charges against him.

But we'll have to wait and see what the court thinks. US courts are usually very wary of actions that offend the separation of powers but are at the same time are often unwilling to override a president's executive decisions.

It's not clear which way the court will go — but there is a lot riding on their decision.

Lucia Osborne-Crowley is a journalist covering law, gender and politics, and a legal researcher specialising in constitutional law who has previously taught US politics at the University of Sydney.

Editor's note: an earlier version of this story incorrectly stated that Matthew Whitaker was Mr Trump's chief-of-staff. Rather, he was Jeff Sessions' chief-of-staff.