Veteran senator John McCain has led criticism of Donald Trump‘s decision to pardon the controversial former sheriff Joe Arpaio, saying it “undermines his claim for the respect of rule of law”.

The long-serving Arizona senator joined a chorus of condemnation of the move, announced as Texas battened down the hatches in preparation for Hurricane Harvey.

Mr Arpaio, 85, ignored a 2011 court ruling that blocked him from racially profiling Latino residents and was convicted of contempt of court less than a month ago, leaving him facing potential time behind bars.

He had gained notoriety for backing Mr Trump’s “birther” campaign and for his massive roundups of suspected illegal immigrants. At Maricopa County jail he reinstated chain gangs and banned coffee, salt and pepper.

Mr Trump said Mr Arpaio was an “American patriot” who “kept Arizona safe!”.

But his longtime critic, Mr McCain, said: “No one is above the law and the individuals entrusted with the privilege of being sworn law officers should always seek to be beyond reproach in their commitment to fairly enforcing the laws they swore to uphold.

“Mr Arpaio was found guilty of criminal contempt for continuing to illegally profile Latinos living in Arizona based on their perceived immigration status in violation of a judge’s orders.

“The President has the authority to make this pardon, but doing so at this time undermines his claim for the respect of rule of law as Mr Arpaio has shown no remorse for his actions.”

Trump calls for unity one day after 75-minute rant at Arizona rally

Cecillia Wang, a lawyer who helped press the racial profiling case against Mr Arpaio, called the pardon ”a presidential endorsement of racism”.

Mr Trump “has acted in support of illegal, failed immigration enforcement practices that target people of colour and have been struck down by the courts”, she said.

Her view was echoed by former Democratic presidential candiate Senator Bernie Sanders, who said the pardon “has again made clear [Mr Trump] will use the powers of the presidency to defend racism and discrimination”.

And Hilarie Bass, president of the American Bar Association, said: “Pardoning a law enforcement officer who has disobeyed the courts and violated the rights of people he has sworn to protect undercuts judicial authority and the public’s faith in our legal system.”

Donald Trump's first 100 days: in cartoons Show all 33 1 /33 Donald Trump's first 100 days: in cartoons Donald Trump's first 100 days: in cartoons Donald Trump's first 100 days in office were marred by a string of scandals, many of which caught the eye of the Independent's cartoonists Donald Trump's first 100 days: in cartoons Trump's first 100 days have seen him aggressively ramp up tensions with his nuclear rivals in North Korea Donald Trump's first 100 days: in cartoons Mr Trump has warned of a "major, major conflict" with the pariah nation lead by Kim Jong Un Donald Trump's first 100 days: in cartoons Mr Trump dropped the "mother of all bombs" on alleged ISIS-linked militants in Afghanistan, amid an escalation of US military intervention around the globe Donald Trump's first 100 days: in cartoons Mr Trump has been accused of falling short of the standards set by his predecessors in the Oval Office, including Franklin D Roosevelt Donald Trump's first 100 days: in cartoons The tycoon's ascension to the White House came at a time when the balance of power is shifting away from Western nations like those in the G7 group Donald Trump's first 100 days: in cartoons Western politicians, including the British Conservative party, have been accused of falling in line behind Mr Trump's proposals Donald Trump's first 100 days: in cartoons Brexit is seen to have weakened Britain, reducing still further any political will to resist American leadership Donald Trump's first 100 days: in cartoons Mr Trump's leadership has been marked by sudden and unexpected shifts in global policy Donald Trump's first 100 days: in cartoons Trump's controversial missile strike on Syria, which killed several citizens, was seen by some analysts as an attempt to distract from his policy elsewhere Donald Trump's first 100 days: in cartoons The President has also spent a large majority of his weekends golfing, rather than attending to matters of state Donald Trump's first 100 days: in cartoons Though free of gaffes, a visit from Chinese president Xi Jinping spotlighted trade tensions between the two states Donald Trump's first 100 days: in cartoons One major and unexpected setback came when Mr Trump's Healthcare Bill was struck down by members of his own party Donald Trump's first 100 days: in cartoons Mr Trump has been a figure of fun in the media, with his approval at record lows Donald Trump's first 100 days: in cartoons A string of revelations about Mr Trump's financial indiscretions did not mar his surge to the White House Donald Trump's first 100 days: in cartoons Outgoing President Barack Obama was accused of wiretapping Trump Tower by his successor in America's highest office Donald Trump's first 100 days: in cartoons The alleged involvement of Russian intelligence operatives in securing Mr Trump the presidency prompted harsh criticism Donald Trump's first 100 days: in cartoons The explosive resignation of Security Adviser Michael Flynn, who lied about his links to the Russian ambassador, was just one scandal to hit the President Donald Trump's first 100 days: in cartoons Many scandals, such as the accusation Barack Obama was implicated in phone-hacking, first broke on Mr Trump's Twitter feed Donald Trump's first 100 days: in cartoons Donald Trump's election provoked mass protests in the UK, with millions signing a petition to ban him from the country Donald Trump's first 100 days: in cartoons Donald Trump cited a non-existent terror attack in Sweden during a campaign rally Donald Trump's first 100 days: in cartoons Donald Trump stands accused of stoking regional tensions in Eastern Asia Donald Trump's first 100 days: in cartoons North Korea has launched a number of failed nuclear tests since Mr Trump took power Donald Trump's first 100 days: in cartoons Theresa May formally rejected the petition calling for Mr Trump to be banned from the UK Donald Trump's first 100 days: in cartoons When Mr Trump's initial so-called Muslim ban was struck down by a federal justice, the President mocked the 69-year-old as a "ridiculous", "so-called judge" Donald Trump's first 100 days: in cartoons A week after his inauguration, Theresa May met with Mr Trump at the White House Donald Trump's first 100 days: in cartoons Donald Trump's first days in office were marked by a hasty attempt to follow through on many of his campaign promises, including the so-called Muslim ban Donald Trump's first 100 days: in cartoons Donald Trump's decision to ban citizens of many majority-Muslim countries from the US sparked mass protests Donald Trump's first 100 days: in cartoons Revelations about Donald Trump's sexual improprieties were not enough to keep him from being elected President Donald Trump's first 100 days: in cartoons British PM Theresa May was criticised by many in the press for cosying up to the new President Donald Trump's first 100 days: in cartoons One of Mr Trump's top aides, Kelly Anne Conway, was mocked for describing mistruths as "alternative facts" Donald Trump's first 100 days: in cartoons British PM Theresa May was quick to demonstrate that her political aims did not hugely differ from Mr Trump's Donald Trump's first 100 days: in cartoons Donald Trump's inauguration, on 20 January 2017, sparked protests both at home and abroad

Tom Perez, the chairman of the Democratic National Convention, said the President had given “a free pass to his buddy Joe Arpaio, the nation’s most notorious agent of racism and bigotry”. The decision to issue the pardon as a dangerous hurricane was bearing down on Texas was “not presidential”, he added.

Enrique Acevedo, a news anchor for the popular Spanish-language channel Univision, tweeted: “This is all you need to know about Trump’s promise of law and order: He fired James Comey and pardoned Joe Arpaio.”

Jeff Flake, Arizona’s other Republican senator, said on Twitter that “I would have preferred that the President honour the judicial process and let it take its course”. Mr Arpaio was due to be sentenced in October and faced up to six months in prison.

Both Mr Flake and Mr McCain have been public targets of Mr Trump’s anger; Mr Flake for his outspoken criticism of the President, and Mr McCain for his July vote against the repeal of Obamacare – a legislative win Mr Trump desperately needed.

On Twitter, the Phoenix New Times recounted a string of stories that chronicled Mr Arpaio’s 24-year reign.

It said: “By 2015, his fondness for racial profiling had cost the county more [than] $44m. On top of, you know, ruining lives.

“Oh, and one time he staged an assassination attempt against himself? That was weird.”