President Trump has pardoned controversial former Sheriff Joe Arpaio for a misdemeanor criminal contempt conviction.

A statement issued by the White House Friday night said, "Today, President Donald J. Trump granted a Presidential pardon to Joe Arpaio, former Sheriff of Maricopa County, Arizona."

Known as "America's Toughest Sheriff," Arpaio gained a reputation for his harsh — his critics would say cruel — treatment of immigrants in the country illegally.

Arpaio was convicted of criminal contempt earlier this summer for defying a judge's order that his deputies stop detaining immigrants because they lacked legal status. His deputies carried on the practice for 18 months.

Trump hinted at the pardon last week and again at a Phoenix rally Tuesday night.

Last week, he told Fox News he was "seriously considering" a pardon and that Arpaio is a "a great American patriot" who has done "a lot in the fight against illegal immigration." Tuesday night, he asked the crowd of supporters: "Do the people in this room like Sheriff Joe?"

"You know what, I'll make a prediction: I think he's going to be just fine," he said. "OK? But I won't do it tonight, because I don't want to cause any controversy."

The statement issued by the White House said:

"Arpaio's life and career, which began at the age of 18 when he enlisted in the military after the outbreak of the Korean War, exemplify selfless public service. After serving in the Army, Arpaio became a police officer in Washington, D.C. and Las Vegas, NV and later served as a Special Agent for the Drug Enforcement Administration (DEA), formerly the Bureau of Narcotics. After 25 years of admirable service, Arpaio went on to lead the DEA's branch in Arizona."In 1992, the problems facing his community pulled Arpaio out of retirement to return to law enforcement. He ran and won a campaign to become Sheriff of Maricopa County. Throughout his time as Sheriff, Arpaio continued his life's work of protecting the public from the scourges of crime and illegal immigration. 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."

In an interview with NPR's Wade Goodwyn last Thursday, Arpaio had equally effusive praise for Trump, predicting that he will end up regarded as the greatest president in American history. He also said he thought that, like him, Trump had been unfairly smeared as a racist. "We need him and I feel sad how they're trying to destroy him. It makes me sick," he said. "I'll tell you one thing, he's got guts and courage and that's what this country needs."

Arpaio said he didn't ask for a pardon and, as of late last week, had not spoken directly to Trump about one. The misdemeanor conviction carries a possible sentence of up to six months.

Among his most controversial measures, the sheriff instructed his deputies to detain Hispanic residents and inquire about their legal status. He then disregarded a federal judge's ruling that he didn't have the legal authority to do so.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.