US President Donald Trump on Friday granted a pardon to former Arizona lawman and political ally Joe Arpaio, the self-proclaimed "toughest sheriff in America," less than a month after he was convicted of criminal contempt in a case involving his department's racial profiling policy.

Mr Trump had signalled this week that the first presidential pardon of his administration would go to Mr Arpaio, 85, whom he has frequently praised for his hardline immigration stance.

"Throughout his time as sheriff, Arpaio continued his life's work of protecting the public from the scourges of crime and illegal immigration," said the White House statement announcing Mr Arpaio's pardon.

Mr Arpaio, who lost a bid for re-election in Arizona's Maricopa County in November after 24 years in office, was known for his crackdown on undocumented immigrants and investigating unfounded Trump-supported claims questioning former President Barack Obama's citizenship.

Before Mr Trump granted the pardon, the American Civil Liberties Union, which sought the court injunction against Mr Arpaio, said it would be "a presidential endorsement of racism."

Mr 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 suspicion that they were in the country illegally.

Mr 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.

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

His controversial tenure as sheriff brought Mr Arpaio national headlines for massive roundups of suspected illegal immigrants 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.