Arpaio was convicted in July of criminal contempt of court for flouting a judge’s order to stop racially profiling Latinos on the suspicion they were undocumented immigrants. He had an extensive history of abusing inmates in his care, including by maintaining an open air “Tent City” detention facility that frequently topped 110° Fahrenheit. Arpaio, who endorsed Trump in January 2016, once called it a concentration camp.

During a White House press conference with the president of Finland Monday, Trump said Arpaio “was very unfairly treated by the Obama administration, especially right before an election, an election that he would have won.” Obama’s Justice Department prosecuted the case against Arpaio, and the former sheriff has said he believed the case against him was politically motivated.

Trump said separately: “I thought he was treated unbelievably unfairly when they came down with their big decision to go get him right before the election voting started, as you know, and he lost in a fairly close election. He would have won the election, but they just hammered him just before the election. I thought that was a very, very unfair thing to do.” Arpaio lost his reelection bid by double digits.

Trump also said that he brought up Arpaio’s name to wild applause at a campaign rally days before the pardon.

“When I mentioned him the other night, you saw the massive crowd we had,” he said. “The people went crazy when I said, ‘What do you think of Sheriff Joe?’ or something to that effect. The place went absolutely crazy.”

He also seemed to address the criticism that he pardoned Arpaio as Hurricane Harvey landed in Texas in order to avoid scrutiny. The White House announced the pardon in a statement around 8 p.m. ET on Friday.

“Actually, in the middle of the hurricane, even though it was a Friday evening, I assumed the ratings would be far higher than they would be normally,” he said. “The hurricane was just starting, and I put it out that I had pardoned, as we say, Sheriff Joe.”

In his defense of the decision to pardon Arpaio, Trump spent a most of his time reading from prepared notes, detailing pardons and commutations that Presidents Clinton and Obama made.

“Sheriff Joe is a patriot,” he concluded. “Sheriff Joe loves our country. Sheriff Joe protected our borders. And Sheriff Joe was very unfairly treated by the Obama administration, especially right before an election, an election that he would have won. And he was elected many times. So I stand by my pardon of Sheriff Joe and I think the people of Arizona who know him best would agree with me.”