Former Sheriff Joe Arpaio of Arizona is now a convicted criminal. The longest-serving lawman of the state’s most populous county, where he became a national figure known for immigration raids and sweeps aimed at rounding up illegal migrants, was found guilty Monday of contempt of court. He faces up to six months in jail.

The ruling was made by U.S. District Judge Susan Bolton, and sentencing could come as soon as October. Legal experts doubt Arpaio will spend a day in jail, but the criminal conviction is the last major blow to the 85-year-old’s record, one that spans six terms in elected office.

Arpaio lost reelection for the first time last November, which from the outside looking in, may have seemed a bizarre rejection of his  hardline immigration policies at a time when many of those same policies were favored by then-candidate Donald Trump . In fact, Arpaio was an early Trump supporter, and there was speculation he’d be asked to join the campaign as late as last July, when he gave a speech for Trump at the Republican National Convention. The rejection of Arpaio in last year’s election, however, came at a time when Maricopa County had turned away from the more controversial politicians who had made it the leader in anti-immigration policy. It also came after Arpaio had been in and out of courtrooms for the majority of a decade, first for a federal racial-profiling case, then for violating an injunction order, then for a federal civil contempt-of-court trial, and finally for the criminal trial.

The origin of Arpaio’s conviction came in 2011, when the U.S. Department of Justice (DOJ) found his office guilty of racial profiling. One federal investigator called it the “most egregious” recent example of profiling in the U.S. For years Arpaio’s deputies had performed what he termed “crime-suppression operations,” which involved sending dozens of agents to a neighborhood, oftentimes poor and heavily Latino areas, to pull people over for minor infractions. The ultimate goal of these operations was to ask people’s legal status, then turn them over to federal authorities for deportation. As part of a three-year investigation into Arpaio’s office, these sweeps were found to be based largely on racial profiling, and Arpaio was ordered to stop.

Arpaio had conducted the sweeps under the federal 287 G Program, which enables some local law-enforcement offices to act as quasi-immigration agents. In 2009, the federal government rescinded this power, but Arpaio refused to stop. In 2012, Arizona U.S. District Court Judge Murray Snow, ordered an injunction against Arpaio’s office aimed at ending the sweeps, but still, Arpaio refused.

Finally, in 2015, Snow called for a civil trial against Arpaio for ignoring several orders. One of those orders concerned Arpaio’s immigration sweeps, and two others concerned evidence that had been allegedly withheld from federal investigators.  This is where the case ventured into conspiracy, as I wrote leading up to the election last October. (“Melendres case” refers to the original racial profiling lawsuit brought against Arpaio, which later tipped off the DOJ).

In May 2014, a deputy on Arpaio’s immigration-sweep team who’d been arrested on drug charges hung himself on his pool table, leaving behind a video-taped suicide note in which he threatened to expose the sheriff’s office. Deputies department wide, including those on the immigration-sweep team, had made thousands of audio and video recordings of traffic stops and never turned them over to plaintiffs in the Melendres case. When investigators searched the dead deputy’s home, they found some of these recordings and, along with drugs and illegal weapons, hundreds of stolen IDs, Mexican passports, licenses, Social Security cards, all believed to have been confiscated during traffic stops and deliberately hidden. Judge Snow asked Arpaio to turn over the tapes, as well as those from recorded interactions with deputies across the department, and to gather them quietly to avoid tempting deputies to destroy or lose evidence. Instead, Arpaio’s office sent out a mass email alerting supervisors.

In May 2016, Snow found Arpaio guilty of civil contempt of court for violating the orders. Not long after, Snow announced the federal government would seek criminal charges.

During the criminal trial, which consisted of a five-day trial in June and July, Arpaio’s attorney’s argued that Snow’s order was unclear and that though the sheriff had made mistakes, they weren’t willful violations of the order. He also argued that Arpaio delegated much of of the enforcement responsibilities to his subordinates, and that he should not be held responsible for their actions. Unlike the civil case, in the criminal case it was necessary to prove the defendant willfully ignored the order.

In her 14-page ruling, Bolton said there was plenty enough evidence to suggest Arpaio knew what he was doing. She wrote that “testimony shows that Defendant knew of the order and what the order meant in regards to the [Maricopa County Sheriff’s Office] policy of detaining persons who did not have state charges for turnover to [Immigration and Customs Enforcement] for civil immigration violations. Despite this knowledge, Defendant broadcast to the world and to his subordinates that he would and they should continue ‘what he had always been doing.’”

Since he was first elected in 1993, Arpaio made his name for being tough on  crime. The man who called himself the “toughest sheriff in America” is now likely looking for leniency.