The official reason President Donald Trump pardoned former Maricopa County sheriff Joe Arpaio Friday night — issuing the first pardon of his presidency for a criminal contempt-of-court conviction issued for violating a federal court order meant to prevent racial profiling — was Arpaio’s long career in government service.

“Sheriff Joe Arpaio is now eighty-five years old, and after more than fifty years of admirable service to our Nation, he is worthy candidate for a Presidential pardon,” the official pardon statement from the White House read.

But everyone knows the real answer, because the real answer was given by President Trump himself — at a rally on Tuesday night in Phoenix where he all but promised to pardon Arpaio, while coyly saying he wouldn’t do it just yet.

“Do the people in this room like Sheriff Joe?” he asked the crowd, to cheers. “So, was Sheriff Joe convicted for doing his job?” The crowd appeared to agree; the president did too.

The fact that the president (and, for that matter, Arpaio) sees a law enforcement officer violating a federal court order as “doing his job” might seem like a paradox. But it isn’t. Joe Arpaio recognized the fundamental truth of Trump’s worldview even before Trump did: that promising “law and order,” and protection from social disorder in the form of unauthorized immigration and street crime, didn’t require you to actually adhere to the rule of law.

Arpaio succeeded on Trumpism before Trump did

Sheriff Arpaio played a key role in validating Donald Trump, whose candidacy was initially seen as a joke, as the champion of hardline immigration policies and the cultural anxieties that came alongside them. Trump’s first truly major campaign rally, in August 2015, was in Phoenix with Arpaio and some of the “Angel Moms” (mothers of people killed by unauthorized immigrants) he would continue to co-opt as a candidate and president. Arpaio formally endorsed Trump in January 2016 — before a single primary vote had been cast. He took a gamble, and he won.

So it makes sense that Trump, who has some apparent loyalty to people who supported him back when he was one of 17 Republican presidential candidates, would think warmly of Arpaio. But the endorsement isn’t really the basis of their simpatico. It’s just an acknowledgment of the political truth that Trump is engaging in exactly the same brand of politics that Arpaio pioneered a decade earlier. As politicians, they used tough-on-crime rhetoric and breaches of “political correctness” to give the impression of sticking up for law and order; as government executives, they exercised their power to the greatest possible extent, without a ton of attention paid to the rule of law.

Like Trump, Arpaio communicated toughness through big, theatrical stunts — raids conducted with armored vehicles, the pink underwear, the tent cities — that often happened to violate the rights of their targets. (The tent cities were ultimately shut down after being cited as violations of the Eighth Amendment prohibition against “cruel and unusual punishment.”) His “law and order” policies weren’t successful as anti-crime measures (911 response times went up hugely during the heyday of Arpaio’s sweeps), but succeeded in terms of targeting and victimizing the intended people.

In Arizona — a state with a fast-growing Latino population, but also a substantial population of older white residents who had often moved to Arizona from places that hadn’t had many Latinos — anxieties about demographic and cultural change were acute, and Arpaio capitalized on them. By the mid-2010s, those anxieties had percolated through much of the rest of the country as well, and Arpaianism was ready to go national — in the form of Trump.

But when it came to the Maricopa County Sheriff’s Office obeying the laws as well as enforcing them, Arpaio was, at best, uninterested. His internal-affairs office, as Judge Snow found, was more a task force to pursue grudges than an effort to root out misbehavior among deputies. He’s been cited for systematic abuses of power in trying to get his enemies brought up on criminal charges — including local judges, members of the Maricopa County Board of Supervisors, and the former mayor of Phoenix.

In other words, his conviction for contempt of court didn’t come out of the blue. It was a predictable consequence of the way he’d run his department — guided by a philosophy that as long as law-enforcement officials were grabbing headlines by going after undesirable people, the public wouldn’t care so much about how it was done.

The Trump administration has turned that philosophy into a matter of federal rhetoric (such as Trump’s “joke” urging officers to be rough with suspects when shoving them into the backs of police cars) and policy (in walking back court-enforced federal oversight of police departments). President Trump himself is liable to tweet angrily about “so-called” judges when he doesn’t get his way.

Joe Arpaio is lucky that he was convicted under a president who cares more about the order Arpaio professed to maintain than the laws to which he was supposed to adhere. But Donald Trump is far luckier that he had, in Arpaio, a model for how such a politician could operate.