WASHINGTON — President Trump on Friday pardoned Joe Arpaio, the former Arizona sheriff whose aggressive efforts to hunt down and detain undocumented immigrants made him a national symbol of the divisive politics of immigration and earned him a criminal contempt conviction.
In a two-paragraph statement, the White House said that Mr. Arpaio gave “years of admirable service to our nation” and called him a “worthy candidate for a presidential pardon.”
Mr. Trump called Mr. Arpaio “an American patriot” in a tweet later Friday. “He kept Arizona safe!” the president said.
The podcast that makes sense of the most delirious stretch of the 2016 campaign.
In his own tweets, Mr. Arpaio thanked Mr. Trump and called his conviction “a political witch hunt by holdovers in the Obama justice department.” He also pointed his supporters to a website that was accepting donations to help him pay off his legal fees.
Mr. Trump, who made cracking down on illegal immigration a signature campaign issue and had pressed for local officials to do more to assist federal authorities in rounding up undocumented people, had been openly flirting with the idea of pardoning Mr. Arpaio.
“I won’t do it tonight because I don’t want to cause any controversy,” the president said Tuesday night at a campaign-style rally in Phoenix, after asking, “Was Sheriff Joe convicted for doing his job?”
“I’ll make a prediction: I think he’s going to be just fine,” Mr. Trump said.
Mr. Arpaio, 85, served for 24 years as sheriff of Maricopa County — which includes Phoenix — building a national reputation for harsh conditions in his county jail, and for his campaign against undocumented immigrants.
Mr. Arpaio had touted himself as “America’s toughest sheriff,” making inmates wear pink underwear and serving jail food that at least some prisoners called inedible. He was also at the forefront of the so-called birther movement that aimed to investigate President Barack Obama’s birth certificate.
The criminal conviction grew out of a lawsuit filed a decade ago charging that the sheriff’s office regularly violated the rights of Latinos, stopping people based on racial profiling, detaining them based solely on the suspicion that they were in the country illegally and turning them over to the immigration authorities.
A federal district judge hearing the case ordered Mr. Arpaio in 2011 to stop detaining people based solely on suspicion of their immigration status, when there was no evidence that a state law had been broken. But the sheriff insisted that his tactics were legal and that he would continue employing them.
He was convicted last month of criminal contempt of court for defying the order, a misdemeanor punishable by up to six months in jail.
Its timing also raised eyebrows, coming on the eve of Hurricane Harvey, a Category 4 storm, barreling down on coastal Texas. Senator Chuck Schumer, Democrat of New York and the minority leader, accused Mr. Trump of “using the cover of the storm” to pardon Mr. Arpaio and to issue a formal ban on transgender people from joining the military. (The ban also gives the secretary of defense wide latitude to decide whether currently serving transgender troops should remain in the military.)
“The only reason to do these right now is to use the cover of Hurricane Harvey to avoid scrutiny,” Mr. Schumer said in a series of tweets late Friday. “So sad, so weak.”
Mr. Trump’s supporters hailed the pardon as a sign the president was keeping his word on his campaign pledge to crack down on illegal immigration.
Kelli Ward, a former Arizona state senator who is challenging Senator Jeff Flake in a Republican primary for his seat in 2018, called Mr. Arpaio “a patriot who did the job the Feds refused to do.” Mr. Trump has endorsed Ms. Ward’s candidacy.
Meanwhile, Senator John McCain, also an Arizona Republican, denounced the pardon of Mr. Arpaio.
“No one is above the law,” he said, “and the individuals entrusted with the privilege of being sworn law officers should always seek to be beyond reproach in their commitment to fairly enforcing the laws they swore to uphold.”
The discussion about pardoning Mr. Arpaio had begun weeks ago, while Mr. Trump’s chief strategist, Stephen K. Bannon, was still in the administration, according to two people briefed on the matter.
But the decision to make the announcement during a national news blackout related to the impending hurricane was not accidental. Some in the Trump administration had cautioned against it as too controversial, and had urged waiting, if it were going to be done.
Mr. Bannon had favored the move, as had Mr. Trump’s policy adviser, Stephen Miller, a former adviser to Jeff Sessions, the attorney general and a former senator for whom Mr. Miller served as press secretary.
Mr. Sessions and Mr. Miller share a hard-line view on curtailing immigration levels, and Mr. Arpaio had become a national avatar for Mr. Trump, who had a good relationship with the sheriff during the 2016 presidential campaign. Mr. Trump had once told Mr. Arpaio that he would try to help him if he could down the road.
But that was before Mr. Trump was closing in on Hillary Clinton in the presidential race. Still, he was fond of Mr. Arpaio, and was sold on the pardon as a way of pleasing his political base. Additionally, Mr. Miller fought hard for the pardon, according to a senior administration official.