Donald Trump has renewed his attacks on judges and judgements that have gone against his administration after an extraordinary rebuke from Supreme Court Chief Justice John Roberts.

Using Twitter and an impromptu press conference at his Mar-a-Lago resort, the president called for someone – either a group of judges or Congress – to step in and stop the "horrible decisions" being made by the 9th US Circuit Court of Appeals.

The federal appeals court, which is based in San Francisco, has blocked a number of border and immigration orders from Mr Trump during his presidency. Mr Trump tweeted that "judges must not legislate security ...They nothing about it and are making our country unsafe." He said that such decisions would only lead to "bedlam, chaos, injury and death".

The latest outbursts from Mr Trump are part of a nearly week-long tirade after a ruling on Monday by District Court Judge Jon Tigar, who is not an appeals court judge, that halted the Trump administration's attempts to bar migrants who enter the country illegally from applying for asylum.

Mr Trump responded by calling that decision a disgrace and labelling Mr Tigar an "Obama judge". Mr Tigar had been appointed to his seat by Mr Trump's White House predecessor Barack Obama.

On Wednesday, Chief Justice Roberts issued an unprecedented public critique of the president's remarks, defending the independence of the judiciary.

“We do not have Obama judges or Trump judges, Bush judges or Clinton judges," Mr Roberts said. "What we have is an extraordinary group of dedicated judges doing their level best to do equal right to those appearing before them. That independent judiciary is something we should all be thankful for.”

Donald Trump: immigrants to 'present themselves legally' at border or void asylum claim

The president confronted Mr Roberts in a tweet on Thursday: “Roberts can say what he wants, but the 9th Circuit is a complete & total disaster. It is out of control.”

Mr Trump continued on that theme in front of reporters at Mar-a-Lago, calling the court "a big thorn in our side" and said "judges or Congress need to do something to stop it".

After a Thanksgiving Day call with members of the military, Mr Trump told reporters that he liked and respected Chief Justice Roberts, but repeated his complaints about the ninth circuit, on which he said he had shone some light.

Earlier on Twitter, Mr Trump wrote that particular circuit had a "horrible reputation, is overturned more than any Circuit in the Country, 79%, & is used to get an almost guaranteed result". According to data, the ninth circuit is not the most overturned; that distinction belongs to the sixth circuit, based in Ohio.

In the past few weeks, president Trump has ordered several thousand US troops to the US-Mexico border in anticipation of a migrant caravan containing thousands of people – many of them fleeing violence in their home countries – that had been slowly making its way from Central America, through Mexico.

"Our great Law Enforcement professionals MUST BE ALLOWED TO DO THEIR JOB! If not there will be only bedlam, chaos, injury and death. We want the Constitution as written!," Mr Trump tweeted early on Thursday.

Undocumented immigration across the US-Mexico border Show all 14 1 /14 Undocumented immigration across the US-Mexico border Undocumented immigration across the US-Mexico border Immigrant children, many of whom are separated form their parents, are housed in Texas' tent city Reuters Undocumented immigration across the US-Mexico border A two-year-old Honduran asylum seeker cries as her mother is searched and detained near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Undocumented migrants ride on the top of a freight train referred to as the beast, or La Bestia Getty Undocumented immigration across the US-Mexico border A cage inside a US Customs and Border Protection detention facility in Texas Reuters Undocumented immigration across the US-Mexico border US Border Patrol Academy All new agents must complete a months-long training course at the New Mexico facility before assuming their posts at Border Patrol stations, mostly along the US-Mexico border Getty Undocumented immigration across the US-Mexico border US-Mexico border fence A group of young men walk along the Mexican side of the US-Mexico border fence in a remote area of the Sonoran Desert Getty Undocumented immigration across the US-Mexico border US-Mexico border fence in the US Man looks through US-Mexico border fence into the US in Tijuana, Mexico Getty Undocumented immigration across the US-Mexico border US-Mexico border fence US Border Patrol agent Sal De Leon stands near a section of the US-Mexico border fence while stopping on patrol on in La Joya, Texas Getty Undocumented immigration across the US-Mexico border US Border Patrol Academy US Border Patrol instructor yells at trainees after their initial arrival to the academy Getty Undocumented immigration across the US-Mexico border Memorial service in Guatemala Families attend a memorial service for two boys who were kidnapped and killed in San Juan Sacatepequez, Guatemala. Crime drives emigration from Guatemala to the United States, as families seek refuge from the danger Getty Undocumented immigration across the US-Mexico border Arrests on the border Undocumented immigrants comfort each other after being caught by Border Patrol agents near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Detention holding facility A boy from Honduras watches a movie at a detention facility run by the US Border Patrol Getty Undocumented immigration across the US-Mexico border Mexican farm workers Mexican migrant workers harvest organic parsley at Grant Family Farms in Wellington, Colorado Getty Undocumented immigration across the US-Mexico border Mexican family in Arizona A Mexican immigrant family sits in the living room of their rented home in Tuscon, Arizona. The family that Arizona's new tough immigrant law had created a climate of fear in the immigrant community. Getty

The caravan of refugees and migrants was a frequent topic for Mr Trump on the campaign trail ahead of the congressional midterm elections earlier this month. But Mr Trump had been relatively quiet on the subject until the latest spate.

The ninth circuit was the appeals court that ruled against Mr Trump's controversial travel ban in 2017, the initial version of which banned travellers from seven majority-Muslim countries.

The president also hit out at the district court earlier in the week, tweeting: “Every case that gets filed in the 9th Circuit, we get beaten. And then we end up having to go to the Supreme Court, like the travel ban, and we won.”

Support free-thinking journalism and attend Independent events

He said it was a disgrace that the ninth circuit, seen as the more liberal of federal district courts, would routinely rule against the administration.

Mr Trump has a history of lashing out at judges over their decisions. In 2016, he referred to a judge who was presiding over a fraud lawsuit against Trump University as a Mexican as an insult.

He said US District Court Judge Gonzalo Curiel, who was born and raised in Indiana, would be unable to rule fairly because of Trump’s proposal to build a wall along the US-Mexican border.

The president has just successfully placed conservative judge Brett Kavanaugh on the Supreme Court after a controversial confirmation process during which Mr Kavanaugh was accused of sexual assault when a teenager. Justice Kavanaugh has denied the allegations.

Mr Kavanaugh’s confirmation followed Mr Trump placing another conservative judge – Neil Gorsuch – on the Court in 2017.