President Trump stood up for justice and for enforcement of our immigration laws when he courageously granted a pardon Friday to Joe Arpaio, the former sheriff of Maricopa County, Arizona. Despite knowing he would face criticism, the president did what was right.

Arpaio was convicted by a federal judge in July of criminal contempt after being charged with violating a court order that attempted to prevent suspected illegal immigrants from being targeted by the sheriff’s traffic patrols. The sheriff acknowledged continuing the patrols, but said that targeting was not the focus.

Arpaio’s conviction arose out of a lawsuit wrongfully accusing the sheriff’s office of violating the rights of Hispanics, allegedly using racial profiling tactics to identify people for traffic stops, and detaining convicts based only on the suspicion that they were illegal immigrants. Arpaio denied all wrongdoing.

I sat in the courtroom through Arpaio’s trial and concluded that he was wrongfully convicted. As a former law enforcement officer myself and former executive director of the Law Enforcement Alliance of America, I know that Arpaio was dedicated to protecting the public he served and that his highest priority was keeping his community safe.

Hearing testimony during Arpaio’s trial, I realized that any reasonable person who was there to pass judgment on this honest law-abiding man – who gave his life to the rule of law – could never have found him guilty on the evidence presented.

However, the only one who could pass judgment on the former sheriff was U.S. District Judge Susan Bolton, because Arpaio was denied his right to a jury trial under the Sixth Amendment of the U.S. Constitution. The judge’s verdict convicting Arpaio was a travesty of justice.

Arpaio's critics have claimed for a long time that he is a racist and biased against Hispanics. In fact, nothing could be further from the truth.

Under his command, the Maricopa County Sheriff’s Office boasted the highest percentage of Hispanic deputies, detention officers and staff in the state of Arizona. Moreover, he promoted more Hispanic officers to command positions than any other law enforcement agency in the state.

On top of this, Arpaio has two grandchildren who are of Hispanic descent. To say he is biased again his own family members is absurd. Labeling him a racist for enforcing U.S. immigration law is a tired, exhausted, left-wing strategy that fails time and time again.

During his presidential campaign, Donald Trump said that he would be the voice for law enforcement officers everywhere and always fight to protect them when they protected the public.

President Trump held true to his promise by using his presidential pardon for Arpaio to set an important precedent: judges should interpret law and not try to rewrite it. And good men like Arpaio should not be prosecuted, persecuted and punished for doing their jobs.

President Trump recognized that Sheriff Arpaio was doing his job, following the law, and protecting the people of Maricopa County – which includes Phoenix – by punishing criminals to the fullest extent, under the laws on the books.

Arpaio was first elected as sheriff in Maricopa County 1992. He maintained that position for 24 years, receiving the honor of being the longest-serving sheriff ever been elected in the county.

In June, the National Center for Police Defense, which I now head, delivered 40,000 petitions to the U.S. Department of Justice urging it to drop charges against the sheriff.

Arpaio’s case has been politically motivated from the beginning, when the Obama administration’s Department of Justice filed misdemeanor charges against him a mere two weeks before the election, contributing to Arpaio’s loss in his reelection bid.

The Department of Justice typically refrains from taking legal action against an elected official so close to an election in order to avoid influencing the outcome.

Arpaio is now 85-years-old and has over 55 years of experience serving in law enforcement. He knows the limits of his power, and for 55 years stayed within those limits, while keeping the bad guys off the streets and the good people of his community safe. That’s how he earned the title of “Americas Toughest Sheriff.”

By pardoning the wrongly convicted former sheriff, President Trump has shown he stands with the law-abiding people of our great country, who have the right to live in peace and safety. And the president has shown he stands against criminals, including those who have crossed our borders illegally.

The author leads The National Center for Police Defense (NCPD) a non-profit dedicated to helping law enforcement officers who have been charged with a crime while following, “to the best of their ability,” the training and knowledge that they have been taught to use, by their departments. His charity supported former Sheriff Joe Arpaio's legal defense.