Jeff Sessions, who resigned on Wednesday, ranked as one of the most regressive political figures to ever lead the Justice Department. The ousted attorney general spent the last two years reshaping federal law enforcement into a blunter and more punitive instrument, squeezing legal and undocumented immigrants alike, and tilting the scales of justice away from disadvantaged communities.

His departure came as no surprise. President Donald Trump spent the last year and a half publicly railing against the former Alabama senator for his perceived disloyalty in the Russia investigation. Trump announced in September that he would not oust Sessions until after the midterm elections. His resignation, which Sessions pointedly noted was at Trump’s request in his letter, came less than 24 hours after the polls closed.

In a post on Twitter, Trump said that he was naming Matthew Whitaker, Sessions’s chief of staff, as acting attorney general until he names a permanent replacement. Whittaker is expected to be a loyal foot soldier in the interim period. In August 2017, he wrote an op-ed for CNN warning that special counsel Robert Mueller would be “going too far” if he investigated Trump’s personal finances.

Sessions’s departure marks an ignominious end for one of the president’s most effective Cabinet members. Not since A. Mitchell Palmer was the nation’s attorney general so singularly focused on imposing his own ideological vision on the rest of the nation. In the U.S. Senate, Sessions’s strident restrictionist views on immigration had been relegated to the ideological fringes. But as attorney general, he enjoyed unparalleled influence over the machinery of American immigration and wielded it against those hoping to build a better life for themselves in the United States.

His greatest policy triumph amounted to systemic child abuse. Sessions first announced the Trump administration’s campaign to separate migrant families at the border in May. He framed it as an effort to crack down on child trafficking, though the policy’s true purpose was to spread fear among migrants and inflict cruelty upon them. “If you are smuggling a child, then we will prosecute you and that child will be separated from you as required by law,” he declared. Thousands of children were ultimately separated from their parents, and hundreds have yet to be reunited.

The practice brought near-universal condemnation. Medical experts denounced the policy for the psychological trauma it inflicted on children. Former First Lady Laura Bush compared it to Japanese-American internment during World War II. So intense was the criticism that Trump backed down from the policy and signed an executive order to curb separations. But Sessions defended it by invoking a Biblical verse that urges obedience to government power.

Sessions’s other anti-immigration tactics smacked of malign neglect at best and outright malice at worst. In June, he used his power over the nation’s immigration courts to declare that domestic abuse and gang violence could no longer be cited as grounds for asylum. The Justice Department tried without much success to cut off some types of federal funds from cities that don’t cooperate with immigration enforcement and sued California for passing a “sanctuary state” law. In an unusually partisan tone for an attorney general, he often castigated Democrats for what he described as “open borders” policies—a phrase he seemed to deploy against any policies less restrictive than his.

On criminal justice, Sessions also pushed the Justice Department in a retrograde direction after some modest reforms under the Obama administration. He instructed prosecutors to seek the maximum possible sentences in every criminal case, even when they are not necessary or appropriate. He revised civil-forfeiture rules to wipe away restrictions on the widely criticized practice. Sessions also rolled back the Justice Department’s efforts to supervise police departments with histories of persistent constitutional violations because it could “reduce morale” among officers. To justify his draconian approach, he falsely told the American people that he and Trump stopped a crime wave and warned that it would return without his policies.

Sessions’s overall civil rights record was less favorable to marginalized communities than any of his predecessors dating back to the civil rights era of the 1950s and 1960s. Indeed, his efforts are the logical endpoint of the resistance to those movements. “If Trump’s promise is a return to status quo ante,” The Atlantic’s Vann Newkirk II wrote in June, “then Jeff Sessions’s doctrine suggests that he represents a return to status quo ante ante, a regime more plainly constructed on the hierarchies and divisions that have for centuries defined America.”

Sessions instead focused on causes célèbres among conservatives, filing religious-freedom lawsuits and combatting purported threats to free speech on college campuses. Sessions noted during a 2017 speech at Georgetown University that a group of protesters at one university wore masks, which he described as “a common tactic also used by the detestable Ku Klux Klan,” as if nonviolent college students were comparable to America’s first domestic terrorism organization.

All of these policies made him a perfect match for Trump. The great tragicomedy of Sessions’s downfall is that it came not from his objectionable decisions, but from a wise one. Sessions recused himself from the Russia investigation in May 2017, leaving overall command of the inquiry in the hands of Deputy Attorney General Rod Rosenstein. Less than a week later, Trump fired FBI Director James Comey, on Sessions’s recommendation. The move triggered a two-week political firestorm for the administration that only abated after Rosenstein tapped Mueller as special counsel to run the Russia investigation.

Trump blamed Sessions’s decision to step back for setting into motion a chain of events that pushed the inquiry even further beyond the president’s control. In May 2017, the attorney general reportedly offered his resignation, which Trump declined. Their once-close political relationship has never been the same. It’s worth noting that Sessions never heeded calls by his former allies to launch partisan investigations into Trump’s political opponents, and he consistently defended Rosenstein from unjust slights by conservative foes of the Russia investigation. But the attorney general does not get credit simply for doing the right thing. It’s the job.

Some political observers have speculated about the possibility of Trumpism without Trump: the president’s hard-right nativist worldview without his personality flaws, intellectual shortcomings, or political baggage. Sessions proved that it could be enforced as a policy program by someone with enough ideological devotion and bureaucratic skill. Trump’s 18-month campaign to humiliate his own attorney general shows, however, that when choosing between Trumpism or Trump, the president will choose the latter without hesitation.