PHOENIX — Former Arizona Sheriff Joe Arpaio has lost another bid to get a judge disqualified from a racial profiling lawsuit that ultimately discredited his immigration patrols and led to a criminal case against the ex-lawman.

U.S. District Murray Snow on Tuesday rejected the request that Arpaio and his former second-in-command Jerry Sheridan made just days after Arpaio was defeated in last year’s election for the metro Phoenix post.

Arpaio and Sheridan had argued that Snow had improper private conversations with an official hired to monitor the sheriff’s office on behalf of the court and said the encounters included discussions about whether the sheriff’s office had committed contempt of court.

Snow ruled that Arpaio and Sheridan, who has retired from the sheriff’s office, lacked legal standing to seek his removal and had long ago waived their right to try to disqualify the judge from the case.

Six months before Arpaio’s defeat in the 2016 election, the judge found Arpaio and Sheridan in civil contempt of court for defying a 2011 court order to stop traffic patrols that targeted immigrants.

Snow later recommended a criminal contempt charge against Arpaio for ignoring the order. Another federal judge filed the charge against Arpaio and found him guilty. But he was spared a possible jail sentence when President Donald Trump pardoned his misdemeanor conviction in late August.

Snow, who was nominated to the federal bench by President George W. Bush, had ruled in 2013 that Arpaio’s officers had racially profiled Latinos in his immigration patrols.

Two years ago, Snow rejected another request to leave the case from Arpaio, who alleged the judge created the appearance of judicial bias by asking questions about a secret investigation conducted by Arpaio.

Earlier in the profiling case, Arpaio succeeded in getting another federal judge to recuse herself after his lawyers questioned her impartiality.

Arpaio’s successor, Sheriff Paul Penzone, hasn’t asked for Snow’s removal from the case.