Joe Arpaio, a former sheriff in Arizona who built a national reputation as an immigration hard-liner, said on Sunday that he would run again for his old office, the latest turn in a long and polarizing career that included a conviction for criminal contempt, a pardon from President Trump and an unsuccessful bid last year for a Senate seat.

Mr. Arpaio, a Republican, was first elected sheriff in 1992 and was defeated by a Democrat in 2016. If elected in 2020, it would be his seventh term in office.

“Thousands want me to run for Sheriff,” Mr. Arpaio, 87, said on Sunday in a tweet announcing his candidacy. “Ready for bruising, bitter campaign. Never back down.”