Donald Trump announces lawyer Don McGahn is leaving via Twitter

He will remain at the White House until after the expected Senate confirmation vote for Supreme Court nominee Brett Kavanaugh, Trump said in a tweet.

Not that McGahn wasn't planning on leaving, but that he wasn't in the loop about Trump's announcement after the Axios report this morning.

White House Counsel Don McGahn sits behind U.S. President Donald Trump as the president holds a cabinet meeting at the White House in Washington, U.S. June 21, 2018.

While Axios notes McGahn has sometimes had a strained relationship with the president, the lawyer told a confidant he still expects to play an advisory role for Trump and his campaign.

Trump made the announcement on Twitter on Wednesday, ending widespread speculation about McGahn, who will be the latest in a long string of high-ranking advisers to leave Trump's side.

But Mr McGahn was well-liked in Washington DC, with Senate Judiciary Chair Chuck Grassley lamenting his departure.

"Remember the eighth amendment senator", he tweeted at Grassley and Trump, a reference to the Constitution's ban on cruel and unusual punishment.

The conversations have unnerved Trump, who didn't know the full extent of McGahn's discussions, two people familiar with his thinking have said. Before taking the White House post, he was working as a partner at the Jones Day law firm in Washington on issues of political law. His reaction was, "Of course it happened this way", one person said.

However, there is no guarantee Brett Kavanaugh will be confirmed to the Supreme Court, throwing the timing of McGahn's departure into question.

McGahn was also among the White House officials who sounded an alarm when Sessions contemplated resigning as attorney general early in the administration.

Mueller's team is looking into whether Trump obstructed justice in trying to end the investigation. McGahn has been the pipeline for recommendations to Trump; it's not clear that he will be replaced by anyone half as effective. White House officials persuaded Sessions not to resign even after the president berated him for recusing himself from the Russian Federation probe, which led to the appointment of Mueller as special counsel.

"I hope it's not true McGahn is leaving WhiteHouse Counsel".

Previously, Trump had reportedly clashed with McGahn after courts found the former Trump campaign manager Paul Manafort guilty of financial crimes, and Trump openly pondered a pardon.