Image copyright Reuters Image caption Joe Arpaio appeared at Donald Trump's campaign rallies during his presidential bid

US President Donald Trump has pardoned ex-Arizona sheriff Joe Arpaio, who had been convicted of criminal contempt.

Mr Arpaio, 85, was found guilty after he defied a court order to stop traffic patrols targeting suspected immigrants. He was due to be sentenced in October.

The president had hinted at the pardon at a rally in Phoenix on Tuesday.

Thanking the president, Mr Arpaio said his conviction was "a political witch hunt by holdovers in the Obama justice department".

"Thank you.... for seeing my conviction for what it is," tweeted Mr Arpaio .

"I'm not going away," he said, while declining to say whether he would run for sheriff again.

Mr Trump has frequently praised the former sheriff, who is known for his controversial hard-line stance on immigration.

Mr Arpaio appeared on the campaign trail with Mr Trump in 2016 - describing him as "the law-and-order candidate".

In a statement announcing the pardon, his first, Mr Trump 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.

Image copyright Reuters

"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 85 years old, and after more than 50 years of admirable service to our nation, he is a worthy candidate for a presidential pardon."

Joe Arpaio, who styled himself as "America's toughest sheriff", rose to national prominence for his sweeps of undocumented immigrants in Hispanic communities, and for detaining Spanish-speakers under suspicion of being undocumented migrants.

In July 2017, he was found guilty of violating a 2011 order to stop detaining migrants.

The decision to pardon the former policeman was condemned by Democrats and civil rights groups.

Democratic Senator Patrick Leahy said it was "disheartening that [the president] set the bar so very low for his first pardon".

Greg Stanton, the mayor of Phoenix, Arizona, called the move a slap in the face for the Latino community and those who had been victimised.

Sorry, this Twitter post is currently unavailable.

Mr Arpaio, born in Springfield, Massachusetts, could have faced six months in jail at his sentencing in October.

He served in the US military before he became a police officer - where he quickly acquired a reputation for his anti-immigration stance and tough enforcement tactics.

The former sheriff lost a bid for re-election in Arizona's Maricopa County in November 2016, after 24 years in office.

Mr Arpaio famously forced the prisoners to wear pink underwear and socks and old-fashioned black-and-white striped prison jumpsuits. The inmates lived outdoors while enduring sweltering Arizona desert temperatures.

He also revived chain gangs, including a voluntary one for female prisoners.