US President Donald Trump granted a pardon to a controversial former Arizona law enforcement official less than a month after he was convicted of criminal contempt in a case involving racial profiling.

A White House statement on Friday confirmed the pardon - the first of the Trump administration, of Joe Arpaio.

The 85-year-old, a political ally of the president, was awaiting sentencing on the contempt-of-court conviction at a hearing scheduled to take place in October.

"Throughout his time as sheriff, Arpaio continued his life's work of protecting the public from the scourges of crime and illegal immigration," the White House said, adding that Arpaio was a "worthy candidate" for a presidential pardon.

The pardon drew a swift and harsh denunciation from Latinos and political leaders in Arizona and beyond.

They said the action amounted to an endorsement of racism by wiping away the conviction of a man who has been found by the courts to have racially profiled Latinos in his immigration patrols.

"Pardoning Joe Arpaio is a slap in the face to the people of Maricopa County, especially the Latino community and those he victimised as he systematically and illegally violated their civil rights," Phoenix Mayor Greg Stanton said.

Arpaio, the self-proclaimed "toughest sheriff in America", lost a bid for re-election in Arizona's Maricopa County in November after 24 years in office.

He is known for his crackdown on undocumented immigrants and investigating unfounded Trump-supported claims questioning former President Barack Obama's citizenship.

"I have to thank the president for what he has done, that's for sure," Arpaio told Reuters news agency in a brief telephone interview from his Arizona home. "He's a big supporter of law enforcement."

Joe Arpaio served as sheriff of the Arizona county where Phoenix is located for 24 years [Brian Snyder/Reuters]

Arpaio said his lawyer was sent a copy of the pardon on Friday afternoon and he has scheduled a press conference to discuss what he said were new details in the case. He declined to say if he would run again for sheriff.

"I'm not going away," Arpaio said.

Arpaio had been scheduled to be sentenced on October 5 and faced a fine and maximum sentence of six months in jail.

His controversial tenure as sheriff brought Arpaio national headlines for massive roundups of suspected undocumented migrants and for the way he ran the Maricopa County jail.

He reinstated chain gangs, made inmates wear uniforms that were pink or old-fashioned black and white stripes and forbade them coffee, salt and pepper.

'A dangerous message'

Civil rights advocates slammed Trump's decision as an endorsement of racist and unlawful immigration policies.

"Once again, the president has acted in support of illegal, failed immigration enforcement practices that target people of colour and that have been struck down by the courts," Cecilia Wang, deputy legal director of American Civil Liberties Union (ACLU), said.

READ MORE: The undocumented immigrants deported under Trump

Vanita Gupta, president of the Leadership Conference on Civil and Human Rights and former head of the US Department of Justice's civil rights division, said in a statement that the pardon sent "a dangerous message that a law enforcement officer who abused his position of power and defied a court order can simply be excused by a president who himself clearly does not respect the law".

Arpaio, who campaigned for Trump in 2016, was convicted on July 31 by US District Judge Susan Bolton, who ruled he had willfully violated a 2011 injunction barring his officers from stopping and detaining Latino motorists solely on the suspicion that they were in the country illegally.

Arpaio admitted to inadvertently disobeying the court order but said his behaviour did not meet a criminal standard. He said the prosecution was a politically motivated attempt by the Obama administration to undermine his re-election bid.

Source: News agencies