In 2015, I sat at the table as Joe Arpaio gave depositions for his civil contempt of court case. The trial consumed me for months, and I later watched his testimony in open court. When Trump announced his candidacy, he immediately reminded me of the disgraced sheriff, in the way he spoke — and the way he lied.

Trump doesn’t just channel Arpaio with his over-the-top promises to be tough on crime and his racist approach to immigration enforcement. The two share a bizarre love/hate relationship with the media, and even forged something of a friendship over their mutual commitment to birther conspiracy theories. In many ways, Arpaio’s reign over Maricopa County foreshadowed Trump’s presidency, and their mutual success is a cause for despair among decent people.

President Trump’s pardon of Joe Arpaio was a slap in the face for the communities he tormented and racially profiled. But the episode also offers progressives a glimmer of hope: We beat Arpaio already, and we’ll beat Trump, too.

As a legal intern with the ACLU of Arizona during the Arpaio case, one of my tasks was to watch interview after interview that he gave to the media after he was first barred by a court order from attempting to unilaterally enforce federal immigration laws. I sat in a gray cubicle and listened for hours as he said, over and over again, that he had no intention of honoring the court’s order. Each one of these quotes was catalogued, and the most egregious were offered as proof that he never intended to stop targeting Arizona Latinos. Like Trump’s tweets, Arpaio’s interviews showed a man incapable of choosing his words wisely, and unwilling to stand behind them when questioned.

Arpaio, as a man, is uncategorizable. Although he strikes a larger-than-life pose in the media, I was struck by just how elderly he seems in person, and in open court his rambling testimony occasionally turned incoherent. I once saw him approach the ACLU counsel and offer a firm handshake and brief hug, as if he were greeting an old business pal. In court, he seemed unfazed throughout the hearings, spending most of the time he wasn’t testifying sitting placidly at the defense table with a neutral look on his face. On the stand he occasionally seemed apologetic, but mostly seemed to genuinely believe he had done nothing wrong. It was clear that Arpaio thought he was mostly immune to any punishment the court might dole out. In front of the media, his demure facade disappeared and he angrily lambasted the court proceedings.

As the ACLU and others methodically dismantled Arpaio in the courtroom, even more important work was happening outside, as Latino-led progressive community groups like Puente Arizona inspired daily protests and a wave of organizing. Years before the Women’s March, Maricopa County was marching in opposition to Arpaio. Each day, leaving the courthouse meant making my way through hundreds of people standing against him, armed with signs, puppets, and often a blow-up effigy of the sheriff in handcuffs.

People weren’t just showing up to court hearings; they were staging protests outside of Arpaio’s office, outside of the Fourth Avenue Jail, and outside of his infamous tent city. Behind the scenes, the Bazta Arpaio movement started registering new voters and working to oust the sheriff at the ballot box. In the eyes of the white retiree population of Arizona, it seemed like Arpaio could do no wrong. But the activists pressed on: They were in it for the long haul.

In court, Arpaio sounded a lot like Trump. From outright lies to placing the blame on his subordinates, he tried everything he could to shirk responsibility for the racial profiling that happened under his watch. The courtroom audibly gasped when Arpaio revealed he even had his agency open an investigation into the federal judge presiding over the case.

That same federal judge eventually found that Arpaio had violated the court order to cease targeting Latino Arizonans. After the civil contempt finding, federal prosecutors took up the case and brought criminal contempt charges. He was convicted, but Trump pardoned him before he was even sentenced.

The pardon is a shame on the president who gave it, but it comes late in a game that Arpaio’s opponents had already won. Bazta Arpaio successfully had him voted out of office in 2016, electing Paul Penzone as Maricopa County sheriff. Penzone is now working to erase Arpaio’s shameful legacy, and Maricopa County is moving forward, into a more inclusive, diverse future. Puente and Bazta Arpaio continue to monitor the sheriff’s office and push for progressive policies throughout Arizona.

It is not surprising that Trump has so closely aligned himself with a man like Joe Arpaio, and even less surprising that he tested out his pardon power on someone whose illegal actions he admired. But pardon doesn’t change what matters: Arpaio’s policies were declared unconstitutional, he was found in civil contempt of court, and most importantly, he was voted out of office.

If Trump wants to emulate Arpaio’s disdain for morality, decency, and the rule of law, then he should expect the same downfall. The people of Maricopa County already showed us how it is done: It took time and hard work, but in the end, the people won. And that is hope enough for me.