President Trump has pardoned former Maricopa County Sheriff Joe Arpaio, just days after being advised not to pursue such action until Arpaio was sentenced for contempt.

In a statement Friday evening, the White House said Arpaio's "life and career" exemplified "selfless public service."

"Throughout his time as Sheriff, Arpaio continued his life's work of protecting the public from the scourges of crime and illegal immigration," the statement read.

It added, "Sheriff Joe Arpaio is now eighty-five years old, and after more than fifty years of admirable service to our Nation, he is worthy candidate for a Presidential pardon."

Get Breaking News Delivered to Your Inbox

"I feel very privileged for the president to issue this... pardon," Arpaio told CBS affiliate KPHO. "He's a big supporter of law enforcement. I know it came from his heart,"

Mr. Trump tweeted Friday night that he had granted Arpaio a "full pardon" because Arpaio "kept America safe!"

I am pleased to inform you that I have just granted a full Pardon to 85 year old American patriot Sheriff Joe Arpaio. He kept Arizona safe! — Donald J. Trump (@realDonaldTrump) August 26, 2017

Arpaio thanked Mr. Trump on Twitter, posting that he is "humbled and incredibly grateful" to Mr. Trump.

Thank you @realdonaldtrump for seeing my conviction for what it is: a political witch hunt by holdovers in the Obama justice department! — Joe Arpaio (@RealSheriffJoe) August 26, 2017

I am humbled and incredibly grateful to President Trump. I look fwd to putting this chapter behind me and helping to #MAGA — Joe Arpaio (@RealSheriffJoe) August 26, 2017

I also thank my loyal supporters, who stood shoulder to shoulder w/ me in this fight, and throughout my career. For those who are asking . . — Joe Arpaio (@RealSheriffJoe) August 26, 2017

Arpaio also called out for donations to his legal defense fund.

..how they can con't to help, a donation to my Legal fund go directly to paying off legal fees from this fight https://t.co/wM6SDLLxEN — Joe Arpaio (@RealSheriffJoe) August 26, 2017

Arpaio told Fox News' Sean Hannity that he is "with [Mr. Trump] until the end." Arpaio said he will hold a news conference next week to "get the message out." He accused "certain news media" of "trying to destroy me all these years."

"After all these years, 55 years in law enforcement around the world, here I am on the defense table?" Arpaio said. "Because they wanted to do everything to get rid of me. Certain people – I'll discuss that more next week."

Arpaio was convicted in July for contempt. A federal court said in 2016 that Arpaio's policy as sheriff of using traffic stops and workplace raids to find suspected undocumented immigrants constituted racial profiling. He was convicted in July for ignoring the order to end traffic patrols targeting immigrants.

The Department of Justice said late Friday that Mr. Trump "exercised his lawful authority" and the department respected his decision.

Sen. John McCain of Arizona issued a statement saying that while Mr. Trump has the ability to issue a pardon, "doing so at this time undermines his claim for the respect of rule of law as Mr. Arpaio has shown no remorse for his actions."

"No one is above the law 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," McCain's statement said. "Mr. Arpaio was found guilty of criminal contempt for continuing to illegally profile Latinos living in Arizona based on their perceived immigration status in violation of a judge's orders."

McCain's fellow senator from Arizona, Jeff Flake, tweeted that he "would have preferred the President honor the judicial process and let it take its course."

Regarding the Arpaio pardon, I would have preferred that the President honor the judicial process and let it take its course. — Jeff Flake (@JeffFlake) August 26, 2017

Mr. Trump had alluded to possibly pardoning the former sheriff at his Phoenix rally, coyly telling rally attendees that Apraio was "going to be just fine."

"I won't do it tonight because I don't want to cause any controversy, okay? But Sheriff Joe can feel good," Mr. Trump added.

The reversal comes after White House lawyers determined the contempt charge was reversible. They argued that the federal court order Arpaio ignored -- which served as the basis for the contempt charge -- is unconstitutional.

The White House legal team had also advised Mr. Trump to wait until Arpaio was sentenced, saying the sentence could be lenient and not include any jail time for Arpaio. Sentencing was scheduled for Oct. 5.

In response to Arpaio's pardoning, ACLU Deputy Legal Director Cecillia Wang said in a statement that Mr. Trump has "chosen lawlessness over justice, division over unity, hurt over healing."

Wang added, "Once again, the president has acted in support of illegal, failed immigration enforcement practices that target people of color and have been struck down by the courts. His pardon of Arpaio is a presidential endorsement of racism."