WASHINGTON (Reuters) - U.S. President Donald Trump on Monday defended his controversial pardon of former Arizona Sheriff Joe Arpaio, who was convicted of criminal contempt in a racial profiling case that highlighted tensions over immigration policy in the United States.

Trump, a Republican who has promised to build a wall along the U.S. border with Mexico, found a kindred spirit of sorts in Arpaio, whose tactics as a law enforcement agent in Arizona’s Maricopa County drew condemnation from civil rights groups.

Arpaio was convicted late last month of willfully violating a 2011 injunction barring his officers from stopping and detaining Latino motorists solely on suspicion that they were in the country illegally.

Asked at a White House news conference about broad criticism of the pardon, including from some in his own party, Trump said Arpaio had not been treated fairly, and he criticized previous U.S. presidents for pardons and commutations of their own.

“A lot of people think it was the right thing to do,” Trump said of the pardon, which he had foreshadowed at a political rally in Phoenix last week.

“He’s done a great job for the people of Arizona. He’s very strong on borders, very strong on illegal immigration. He is loved in Arizona. I thought he was treated unbelievably unfairly,” Trump said.

The White House announced Trump’s pardon of the 85-year-old on Friday night as Hurricane Harvey was threatening Texas with devastating floods. Trump, a former reality television star, said he thought television ratings the night of the announcement would have been good because of the storm.

Slideshow ( 2 images )

Trump was ready for the question at a news conference with Finnish President Sauli Niinisto. He pulled a piece of paper out of his pocket with a list of similar actions by President Bill Clinton and President Barack Obama that also drew controversy.

“President Clinton pardoned Marc Rich, who was charged with crimes going back decades,” Trump said.

Clinton’s pardon of Rich for tax evasion, racketeering and violating sanctions with Iran, drew widespread criticism.

“President Obama commuted the sentence of Chelsea Manning, who leaked countless sensitive and classified documents to WikiLeaks, perhaps and others. But a horrible, horrible thing that he did. Commuted the sentence and perhaps pardoned.”

Obama did not pardon Manning, who provided documents, videos and diplomatic cables to WikiLeaks, but he shortened her sentence to seven years from 35.

Arpaio campaigned for Trump in 2016 and investigated unfounded claims that Obama was not born in the United States, a falsehood that Trump also espoused for years.

“Sheriff Joe is a patriot. Sheriff Joe loves our country. Sheriff Joe protected our borders,” Trump said. “So I stand by my pardon of Sheriff Joe, and I think the people of Arizona, who really know him best, would agree with me.”