“He could possibly win a primary because of his popularity among a hard-core group of supporters in the G.O.P. and his national fund-raising ability,” said Tyler Montague, a Republican campaign strategist in Arizona.

“But in the end he’ll be another Roy Moore,” said Mr. Montague, referring to Mr. Moore’s contentious hard-line positions. “I think a lot of serious conservatives will realize that and reject his candidacy.”

Mr. Arpaio began his long career in law enforcement as a police officer in Washington in 1954. He later worked for the Drug Enforcement Administration in Latin America before his election as sheriff of Maricopa County in 1991.

In almost a quarter-century in that office, Mr. Arpaio developed a national reputation for severe correctional practices and a tireless crusade against illegal immigration. He opened an outdoor jail known as Tent City, turning the desert heat into a punitive element, and forced inmates to wear striped jumpsuits and pink underwear. His department conducted broad “saturation patrols” of heavily Hispanic neighborhoods, often without evidence of criminal activity, and routinely detained people beyond their court-ordered release dates so they could be handed over to federal immigration authorities.

A professed media hound, Mr. Arpaio reveled in publicity, using bold headlines and public outrage to his advantage in firing up conservatives who embraced his hard-line policies. “Arpaio was Trump before Trump was Trump,” said David Berman, professor emeritus of political science at Arizona State University.

In 2016, Mr. Arpaio, who had advanced the myth that President Barack Obama was not born in the United States, emerged as an early Trump endorser in Arizona, where Mr. Trump held no fewer than seven campaign rallies during the presidential race. But the communities Mr. Arpaio had agitated with such persistence ultimately drove him from office: He lost his bid for a seventh term as sheriff that November, pushed out by energized Latino voters. Mr. Trump would carry the state by four percentage points in the same election.

Chuck Coughlin, a veteran Republican strategist in Arizona, said in an interview that his first reaction to Mr. Arpaio’s announcement was that it could be “some kind of a joke,” referring to previous talk by Mr. Arpaio about running for governor.