Sen. Jeff Flake, R-Ariz., expressed his dismay at President Trump's decision to pardon former Maricopa County Sheriff Joe Arpaio on Friday.

"Regarding the Arpaio pardon, I would have preferred that the President honor the judicial process and let it take its course," Flake said in a tweet.

However, Dr. Kelli Ward, who is the only Republican running against Flake for his Senate seat in the 2018 election, praised Trump for pardoning Arpaio.

"Thank you, @RealDonaldTrump so glad you #pardoned @RealSheriffJoe - a patriot who did the job the Feds refused to do #StopIllegalImmigration," Ward tweeted.

Earlier in the evening, the White House announced the pardon for Arpaio, who last month was found in criminal contempt of court for not following a different judge's orders to stop traffic patrols that targeted illegal immigrants due to a record of discriminating against Latinos. Arpaio was found in civil contempt of court in May. Arpaio was an ardent supporter of Trump's during the campaign.

Trump has repeatedly criticized Flake, who is up for re-election in 2018.

Trump rallied in Phoenix earlier in the week, where he teased a coming Arpaio pardon and took shot at Flake without saying his name, saying he is "weak on border, weak on crime." Then in a follow-up tweet, Trump made a similar jab mentioning Flake by name.

Flake said he would ignore the attacks and continue to support Trump.

"So for my part, I'll continue to support the president, work with him when I think he's right, and challenge him when I think he is going in the wrong direction," Flake said.