LGBT rights groups have condemned President Donald Trump's decision to pardon former Maricopa County Sheriff Joe Arpaio.

The 85-year-old Arpaio served as sheriff for 24 years. In July, a federal judge found Arpaio guilty of criminal contempt of court, finding that he had defied a judge's order to stop arresting immigrants suspected of being in the United States illegally.

“I am pleased to inform you that I have just granted a full Pardon to 85 year old American patriot Sheriff Joe Arpaio,” Trump tweeted on Friday. “He kept Arizona safe!”

Arpaio told the AP that he was grateful for the pardon.

“I appreciate what the president did,” he said. “I have to put it out there: Pardon, no pardon – I'll be with him as long as he's president.”

JoDee Winterhof, senior vice president for policy and political affairs at the Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, said that by pardoning Arpaio Trump was “aligning himself with his nationalist, racist, anti-LGBTQ supporters.”

“Joe Arpaio must be held accountable for his long record of violating the civil rights of Maricopa County’s Latinx population, and carrying out a hate-filled agenda through extreme racial profiling,” Winterhof said in a statement. “During his tenure, Arpaio has attacked nearly every marginalized community, including using anti-LGBTQ schemes to humiliate inmates at his ‘Tent City’ prison. By pardoning Arpaio, Trump is again aligning himself with his nationalist, racist, anti-LGBTQ supporters – only two weeks after the violent extremism in Charlottesville.”

“This pardon is yet the latest example that bigotry and intolerance are core pillars of Trump's Presidency,” GLAAD Director of Spanish Language and Latinx Media & Representation Monica Trasandes said in a statement. “Trump is sending a chilling message of support for racial profiling, inhumane inmate abuses, and unlawful defiance for the federal court system. The LGBTQ community must stand with all immigrants and communities of color as we fight back against the dangerous and discriminatory agenda of the Trump Administration”

The New York Times in 2008 described Arpaio as “America's worst sheriff.”