The White House counsel, Don McGahn, is leaving the Trump administration this fall, President Donald Trump said Wednesday.

McGahn is said to have cooperated extensively with the special counsel Robert Mueller's investigation into possible criminal wrongdoing by Trump.

McGahn has reportedly clashed with Trump and may have incriminated him during 30 hours of interviews with Mueller's team.

After the news of McGahn's conversations with Mueller went public, Trump tweeted that McGahn was not a "RAT" like the White House counsel John Dean in the Watergate scandal.

The White House counsel, Don McGahn, is leaving the Trump administration in the fall, President Donald Trump said Wednesday.

His planned departure comes after he cooperated extensively with the special counsel's investigation into possible criminal wrongdoing from Trump.

Trump said McGahn would "hopefully" leave the administration after the confirmation of Judge Brett Kavanaugh to the Supreme Court.

"I have worked with Don for a long time and truly appreciate his service!" Trump said.

Trump was said to have clashed with McGahn after Trump openly pondered a pardon for Paul Manafort, the former Trump campaign chairman whom a jury last week found guilty of financial crimes unrelated to the campaign.

Vanity Fair reported on Monday that McGahn refused to participate in the pardoning process and that Trump considered bringing on a new lawyer.

McGahn was already reported to have extensively cooperated with the special counsel Robert Mueller in a way that could have incriminated Trump in the investigation into whether he obstructed justice in connection to the Russia investigation.

The New York Times reported earlier in August that McGahn had given 30 hours of interviews to Mueller over the past nine months. The report said that during those talks, McGahn and his lawyer focused on absolving McGahn of wrongdoing while candidly discussing inner-circle conversations with Trump related to the investigation.

These discussions reportedly touched on Trump's firing of FBI Director James Comey and his focus on putting loyal officials in charge of the investigation, such as Attorney General Jeff Sessions.

Trump called The Times' story "Fake" because he said it implied that McGahn had become a "RAT" like John Dean, the White House counsel who cooperated with prosecutors in the Watergate scandal that helped end Richard Nixon's presidency.

Trump insisted that he actually allowed McGahn and others to cooperate with Mueller because he had "nothing to hide" and wanted to get to the end of the investigation.

More quietly, away from the scandals that dominate news coverage, McGahn helped Trump select a record number of conservative federal judges in what may prove to be one of Trump's more consequential moves as president.

Emmet Flood, a former Clinton administration official who joined the White House in May to help with the Russia investigation, is a likely replacement for McGahn, the news website Axios reported.