WASHINGTON (Reuters) - White House counsel Don McGahn, whose relationship with President Donald Trump has been strained by the investigation into Russian interference in the 2016 presidential election, is set to leave the job in coming weeks.

Trump announced on Twitter on Wednesday that McGahn would step down after the U.S. Senate confirms the nomination of Brett Kavanaugh to the Supreme Court. That was widely expected to occur before the court begins its next term in early October.

McGahn will be the latest senior adviser to leave Trump’s side, underscoring the White House’s persistent turmoil. But it also may open the way for a replacement who Trump would see as more willing to do battle against the Russia investigation team led by Special Counsel Robert Mueller.

McGahn did not know the president’s tweet was coming, an administration official said, but he had been planning to leave the White House because he felt he had made his mark in getting conservatives named to federal judgeships, rolling back regulations and reeling in the bureaucracy.

Trump announced McGahn’s departure less than two weeks after it was reported that McGahn had voluntarily cooperated with Mueller’s probe into Russian meddling and possible collusion between Moscow and the Trump campaign. The president repeatedly has slammed the inquiry as a witch hunt.

In his interviews with Mueller’s team, McGahn was asked about Trump’s actions in firing FBI Director James Comey in 2017, the Washington Post has reported. Other topics included Trump’s criticism of Attorney General Jeff Sessions and Deputy Attorney General Rod Rosenstein, who oversees the Russia probe, the Post said.

After sending his tweet, Trump told reporters at the White House that he has “a lot of affection for Don” and said he was not concerned about what McGahn told the Mueller team. “We do everything straight,” he said. “We do everything by the book. And Don is an excellent guy.”

Mueller’s investigation already has resulted in guilty pleas for several Trump insiders, indictments, cooperation deals and one conviction.

Russia has denied meddling in the election.

FILE PHOTO: 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. REUTERS/Jonathan Ernst

POSSIBLE REPLACEMENTS

Trump has not settled on a replacement for McGahn, White House spokeswoman Sarah Sanders told reporters.

There has been speculation the job would go to Emmett Flood, a veteran Washington lawyer who joined the White House in May to help with the Russia probe.

Flood has kept a low profile since then, but he is well-known for his skepticism about special investigations.

Two decades ago, he advised President Bill Clinton on impeachment proceedings stemming from Independent Counsel Kenneth Starr’s Whitewater probe.

“People like him,” Sanders said of Flood. “He’s super well-respected around the building but there’s not a plan locked in place at this point.”

Also in contention: Makan Delrahim, the Justice Department’s top antitrust enforcer, who helped McGahn steer Supreme Court Justice Neil Gorsuch through the Senate confirmation process, the Wall Street Journal reported, citing an unnamed source.

Delrahim did not respond to questions about the report.

Flood’s Ivy League degree may give him an edge, said a person familiar with Trump’s thinking. “Trump is obsessed with credentials for lawyers,” the source said. “Delrahim went to a good school, but Emmet went to Yale.”

However, Trump may want to keep Flood focused exclusively on the Russia probe rather than expanding his role, said Andrew Boutrous, a former federal prosecutor.

McGahn could not be reached for comment.

With his departure, he will become part of an unprecedented level of turnover among modern administrations studied by presidential scholars. Of Trump’s top 27 aides listed on his first annual staff report to Congress, McGahn will be the 17th to depart.

It is not unusual for presidents to swap out general counsels. Democrat Bill Clinton went through six top legal aides in two terms in office; Democrat Barack Obama had four; Republican George W. Bush had three.

RESHAPING THE BENCH

With McGahn’s help, Trump has reshaped the federal judiciary in a conservative direction, tilting the balance on the Supreme Court rightward, and filling a record-breaking number of seats on federal appeals courts. These successes have helped Trump build and retain support among Republican voters.

McGahn’s record on judicial nominations prompted Senate Judiciary Committee Chairman Chuck Grassley, to write in a tweet addressed to Trump: “U can’t let that happen.”

Senate Republican leader Mitch McConnell praised McGahn as “the most impressive White House Counsel during my time in Washington.”

In one of his stormiest moments as White House lawyer, McGahn threatened to quit in June 2017 because he was “fed up” after Trump insisted he take steps to remove Mueller, a person familiar with the matter told Reuters earlier this year.

McGahn also was involved in the controversy surrounding Trump’s firing of former national security adviser Michael Flynn. In January 2017, then-Acting Attorney General Sally Yates informed McGahn that Flynn had misled the FBI about his discussions with former Russian ambassador to the United States Sergei Kislyak. Flynn pleaded guilty in December 2017 to lying to the FBI.