US President Donald Trump has granted a pardon to former Arizona lawman and political ally Joe Arpaio, less than a month after he was convicted of criminal contempt.

US President Donald Trump has spared former Arizona sheriff Joe Arpaio the prospect of serving jail time in granting the first pardon of his turbulent tenure, wiping away the lawman's recent federal conviction stemming from his immigration patrols that focused on Latinos.

The White House said 85-year-old Arpaio was a "worthy candidate" for the pardon, citing his "life's work of protecting the public from the scourges of crime and illegal immigration". Trump granted the pardon less than a month after a judge found Arpaio guilty of a misdemeanour contempt-of-court charge in a trial that was prosecuted by the president's own US Justice Department.

"I appreciate what the president did," Arpaio told The Associated Press as he celebrated the news over an Italian restaurant meal and someone in his party ordered champagne. "I have to put it out there: Pardon, no pardon - I'll be with him as long as he's president."

BRIAN SNYDER/REUTERS Joe Arpaio joins then-US presidential candidate Donald Trump on stage at a 2016 campaign rally.

The pardon drew a swift and harsh denunciation from an array of Latinos and political leaders, who said it amounted to presidential approval of racism by eliminating the conviction of a law officer who the courts said had used immigration patrols to racially profile Latinos. And it overturned what critics saw as a long-awaited comeuppance for a lawman who long escaped accountability for his use of headline-grabbing tactics as sheriff in Phoenix.

READ MORE:

* Trump looks beyong peril to 2020

* Trump's low approval ratings set record

* Alec Baldwin back as Trump

* Trump dumps another staffer

* Shutdown threat 'blackmail'

CAITLIN O'HARA/REUTERS Maria Cruz Ramirez, right, comforts Bertha Martinez in Phoenix after former Arizona sheriff Joe Arpaio was pardoned by US President Donald Trump.

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

The White House announced the pardon late on Friday (Saturday NZ Time) as a powerful Category 4 hurricane threatened Texas with severe flooding and on the same day Trump fleshed out the details of his ban on transgender individuals serving in the military, another move that will cheer his conservative base. The decision followed the uproar that ensued after Trump assigned blame to "both sides" participating in race-fueled clashes in Charlottesville, Virginia, this month.

Trump has been plagued by poor job approval ratings, currently at 34 per cent, the lowest mark ever for a US president in his first year.

CAITLIN O'HARA/REUTERS Local immigrants rights organiSations gather to protest in Phoenix after former Arizona sheriff Joe Arpaio was pardoned by US President Donald Trump.

His decision on the former sheriff may also serve to energise supporters dispirited by the president's dismissal a week ago of White House chief strategist Steve Bannon, a favourite on the far right wing of the Republican Party.

GOP leaders were mixed in reacting to the pardon. Senator John McCain criticised the move and said it undermined Trump's "claim for the respect of rule of law as Mr Arpaio has shown no remorse for his actions". Republican Governor Doug Ducey said Arpaio should be given credit for his crime-fighting efforts and allowed to "move on" and enjoy his retirement.

Arpaio earned a national reputation by taking aggressive action to arrest immigrants in the country illegally. But years of legal issues and related costs took a toll on his political power at home, and he was handily defeated by a Democrat in the 2016 election.

BRIAN SNYDER/REUTERS Joe Arpaio is a political ally of US President Donald Trump.

The loss coincided with Trump's election, based in large part on his anti-immigrant rhetoric. Arpaio campaigned for him around the country and spoke at the Republican National Convention.

Arpaio defied court orders that he stop the patrols and has been pardoned by a president who has shown lack of respect for judges with whom he disagrees. Trump has had harsh words about judges overseeing the case against his now-defunct Trump University and his travel ban.

"So Sheriff Joe was convicted for doing his job?" Trump asked supporters at Tuesday's rally. "I'll make a prediction. I think he's going to be just fine, OK."

Trump issued the pardon seven months after taking office, though it is not unprecedented for a president to issue a pardon in their first year in office.

George H. W. Bush granted clemency after seven months in office, said Jeffrey Crouch, a professor of politics at American University who wrote a book on presidential pardons.

Asked whether Trump sought a recommendation from the US Justice Department's pardon attorney or the deputy attorney general, White House press secretary Sarah Huckabee Sanders said: "I would imagine they go through the thorough and standard process."

It is not unheard of for a president to exercise his broad power to grant pardons without formal input from the US Justice Department, particularly when it involves an associate or a friend. Former US President Bill Clinton ignited a major controversy on his final day in office with a last-minute pardon for fugitive financier Marc Rich, the ex-husband of a major Democratic fundraiser.

Former US President George W. Bush set off a political backlash over his decision to commute the prison sentence of I. Lewis "Scooter" Libby on a perjury and obstruction of justice case that stemmed from a CIA leak. And Gerald Ford pardoned Richard Nixon for his involvement in the Watergate scandal just days after taking over for his predecessor.

Critics say the Arpaio pardon removed the last opportunity to hold the lawman accountable for what they say is a long history of misconduct, including a 2013 civil verdict in which the sheriff's officers were found to have racially profiled Latinos in his immigration patrols.

Arpaio was accused of prolonging the patrols for 17 months after a judge had ordered them stopped so that he could promote his immigration enforcement efforts in a bid to boost his successful 2012 re-election campaign.

Arpaio acknowledged extending the patrols, but insisted it wasn't intentional. He blamed a former lawyer for not properly explaining the importance of the court order and brushing off the conviction as a "petty crime".

He accused then-US President Barack Obama of trying to influence the 2016 sheriff's race by announcing in court weeks before election day that it was willing to prosecute Arpaio. Prosecutors never filed criminal charges. They were instead recommended by the judge who presided over the profiling case, which began in the Bush administration. The judge in the profiling case was a Bush appointee as well.

Lawyers in Trump's US Justice Department prosecuted the case during a five-day trial, and the judge handed down the conviction last month. Arpaio said he would discuss the case in more detail next week. He said he would remain involved in the political scene now that he was no longer facing jail time.

"I don't fish," Arpaio said. "I'll be very active."