PHOENIX — President Donald Trump’s pardon of former Sheriff Joe Arpaio’s conviction for disobeying a court order in an immigration case will stand after a judge on Wednesday rejected arguments that it would encourage government officials to flout similar judicial commands in the future.

U.S. District Judge Susan Bolton cited U.S. Supreme Court precedent in formally dismissing the criminal case against the former six-term sheriff of metro Phoenix known for his harsh treatment of inmates and immigration enforcement crackdowns.

She held off on ruling on Arpaio’s request to throw out all orders in the case, including a blistering 14-page ruling in which the judge explained her original reasoning in finding that Arpaio was guilty of a crime.

“I have concluded the pardon is valid,” Bolton said.

MORE: What the Arpaio pardon reveals about Trump’s take on the rule of law

The hearing Wednesday came five weeks after Trump pardoned Arpaio’s conviction for intentionally defying a 2011 court order to stop his traffic patrols that targeted immigrants.

The former sheriff, who didn’t attend Wednesday’s hearing in federal court, was accused of continuing the patrols for 17 months so that he could promote his immigration enforcement efforts in a bid to boost his successful 2012 re-election campaign.

Arpaio, who endorsed Trump and appeared alongside him at rallies during the 2016 campaign, has acknowledged prolonging the patrols, but insisted his disobedience wasn’t intentional and blamed one of his former attorneys for not adequately explaining the order’s importance.

Critics say the Aug. 25 pardon removed the last chance at holding Arpaio legally accountable for a long history of misconduct, including a 2013 civil verdict in which Arpaio’s officers were found to have racially profiled Latinos in the sheriff’s immigration patrols. The order that Arpaio acknowledged violating was issued by U.S. District Murray Snow in the profiling case.

Prosecutor John Keller said it was appropriate to dismiss the case against Arpaio.

“This prosecution is over,” Keller said. “The defendant will never be held accountable for his contempt of Judge Snow’s injunction.”

Bolton has previously said case law suggests a pardon doesn’t erase a recipient’s underlying record of conviction and instead is aimed at lessening or canceling punishment. The pardon had previously led the judge to cancel Arpaio’s sentencing hearing.

The judge is considering a request from Arpaio to throw out the ruling that explains his guilty verdict.

The judge is considering a request from Arpaio to throw out the ruling that explains his guilty verdict. In the ruling, Bolton cited television interviews and news releases in which the sheriff made comments about keeping up the patrols, even though he knew they were no longer allowed.

Arpaio’s attorneys have said the requests are aimed at clearing Arpaio’s name and barring the ruling’s use in future court cases as an example of a prior bad act. “This is a matter of basic fairness,” said Arpaio attorney Jack Wilenchik.

Lawyers who won the racial profiling verdict against Arpaio had argued earlier that the decision explaining the guilty verdict should remain intact to serve as a rebuke of the sheriff’s actions and as a deterrent to other politicians who might want to disobey a judge’s orders.

Several legal advocacy groups had requested that the pardon be declared invalid or unconstitutional, arguing that letting it stand would encourage future violations of court orders. More than 30 Democrats in Congress also had asked Bolton to declare the pardon invalid and move forward with sentencing, saying the clemency is an encroachment by Trump on the power and independence of the courts.

Since the pardon, Arpaio has said he did nothing wrong, criticized Bolton as biased and called the offense behind his conviction a “petty crime.” Arpaio, who was defeated last year in the same election that sent Trump to the White House, is now talking about getting back into politics.