When Don McGahn leaves the White House this fall, it will end one of the longest, and most improbably successful, stints in the Trump administration.

President Donald Trump announced on Twitter Wednesday morning that his White House counsel would leave after the presumed confirmation of Brett Kavanaugh to the U.S. Supreme Court. Axios had reported the news earlier Wednesday morning.

McGahn’s exit is not a great surprise—expectations of a departure sometime this fall had circulated for some time, with Kavanaugh’s appointment as the likely bookend. The greater surprise is that McGahn lasted so long in the role, and that he was so effective. He was always a somewhat unorthodox choice; he had an up-and-down relationship with the president, and he has had to withstand one of the most trying periods for any White House counsel in memory. Yet he has lasted longer in his job than almost any other top Trump White House official, and has achieved more in it than any of them, too.

Are Trump’s lawyers an asset or a liability?

McGahn came to the White House from the Trump campaign, for which he’d served as a top lawyer. Although he had some tenuous ties to the president—his uncle had represented Trump in Atlantic City—he was a strange pick. A former member of the Federal Election Commission, McGahn was a member of the Republican establishment that Trump detests. He is stylistically different from Trump. He wears his hair long (by Washington standards), plays in a rock band, and attended a lower-tier law school, which reportedly bothered the status-obsessed president. McGahn had a different key credential: He would take the job, unlike many Republicans who steered clear of the new administration.