President Donald Trump’s pardon of convicted former Arizona sheriff Joe Arpaio drew an immediate tweet of gratitude from the man he spared from a six-month jail term.

"Thank you @realdonaldtrump for seeing my conviction for what it is: a political witch hunt by holdovers in the Obama justice department," Arpaio wrote Aug. 25.

Thank you @realdonaldtrump for seeing my conviction for what it is: a political witch hunt by holdovers in the Obama justice department! — Joe Arpaio (@RealSheriffJoe) August 26, 2017

There is no question that Justice Department officials under President Barack Obama investigated and joined in legal proceedings against Arpaio, but were they driving the court process that led to his conviction on contempt of court?

The court record and legal opinion say Arpaio is pointing at the wrong people.

A quick recap

Arpaio’s path to a guilty verdict began with a 2007 traffic stop in Maricopa County. Under Arpaio, the Maricopa County Sheriff’s Office used a few tactics to sweep up undocumented immigrants. They targeted places where day laborers came to find work. Deputies would follow the cars and trucks that picked them up and stop them. They had guidelines – called Law Enforcement Agency Response or LEAR – to stop any driver suspected of being in the country illegally.

In 2007 Arpaio’s deputies detained Manuel de Jesus Ortega Melendres for nine hours. Melendres was a Mexican tourist with a valid tourist visa. Melendres sued on the basis of racial profiling.

In 2011, federal district Judge G. Murray Snow issued a preliminary injunction, telling Arpaio and his department to stop detaining people without a reasonable suspicion that a crime had been committed.

Snow has no ties to the Obama administration. He was nominated by President George W. Bush in 2007. Snow followed up with a permanent injunction in 2013.

"Any stop or detention based only on a reasonable suspicion that a person is in the country without authorization, without more facts, is not lawful," Snow wrote.

Arpaio’s practices, the judge wrote, violated peoples’ constitutional rights against unreasonable search and seizure and equal protection under law (the fourth and 14th amendments).

The Ninth Circuit Court of Appeals backed up all the key elements of Snow’s ruling in 2015. During this time, Arpaio said in television interviews and statements to the press that he had no intention of changing his tactics.

The guilty verdict

In 2016, Snow referred Arpaio for investigation of criminal contempt of court. The case went to Judge Susan Bolton on the U.S. District Court for the District of Arizona. Bolton, nominated by President Bill Clinton in 2000, heard testimony for five days. In her ruling, she said there was no question that Snow had issued a clear order, that Arpaio knew about the order and that he "willfully violated the order."

"Because the Court finds that Defendant willfully violated an order of the court, it finds Defendant guilty of criminal contempt," Bolton wrote.

In his tweet, Arpaio argued that the hand of the Obama administration was at play.

That overlooks the role of the courts, said law professor and federal criminal procedure expert Joshua Dressler at Ohio State University.

"The matter was entirely in the hands of Judge Bolton," Dressler said. "With or without the Justice Department, the injunction existed."

Arpaio’s personal attorney largely agrees.

"Judge Snow kicked it off," said Jack Wilenchik. "The government prosecutors could have declined to pursue the case, but then Snow would have brought in a private attorney to prosecute the case. There’s a rule about that."

The rule is Rule 42 on criminal contempt in the federal rules of criminal procedure. It says "If the government declines the request, the court must appoint another attorney to prosecute the contempt."

The original case began with the Melendres suit, and a Bush-appointed judge referred the case for criminal prosecution. Another judge, appointed by Clinton, picked up the case.

The Obama Justice Department role

Starting in either mid 2008 or early 2009 (there are Justice Department statements giving both dates,) the Justice Department began its own investigation of Arpaio and his deputies. When the sheriff’s office refused to provide documents, the department sued to get them. The parties settled, and in December 2011, the Justice Department reported that it had determined that Arpaio and the Maricopa County Sheriff’s Office were violating the Constitution and federal law.

The Justice Department sued in 2012 and reached a partial settlement with Sheriff Arpaio and Maricopa County in July 2015.

In effect, Arpaio faced two parallel legal challenges: one from the federal government and one from the Melendres case, which morphed into a class-action suit. They overlapped in substance, but were legally separate.

In 2015, the Justice Department joined the Melendres case to press Maricopa County to obey the judge’s rulings. However, law professor Mark Osler at the University of St. Thomas said that did not make the department a party to the suit.

"Because they weren’t a party in the case, the Justice Department did not have the discretion and power they usually do — the power of controlling the charge," Osler said. "That was in the hands of the judge."

Arpaio's attorney faulted the Obama Justice Department for its October 2016 announcement that it would move forward to prosecute Arpaio.

"That clearly hurt Sheriff Arpaio’s chances for re-election," Wilenchik said.

Trump agrees. At a Aug. 28 news conference he complained that Arpaio had been unfairly treated by the Obama administration specifically related to the election.

Our ruling

Arpaio said that his conviction for contempt of court was the result of a witch hunt by Obama administration Justice Department holdovers. The actual roots of the complaints that led to Arpaio’s conviction lie outside the Justice Department.

A 2007 private lawsuit turned into a class action lawsuit that led a George W. Bush-era federal judge to issue an injunction against Arpaio and his department. Over several years, Arpaio publicly declared that he would not change his ways. The original judge referred Arpaio’s case for criminal prosecution and a Clinton-era judge found him guilty.

The record, the law and legal opinion show the U.S. District Court for the District of Arizona had control of the process, not Justice Department staff linked to the Obama administration.

We rate this claim False.