Chief Justice John Roberts issued a rare rebuke to President Donald Trump on Wednesday morning, defending the "independent judiciary" and contradicting Trump's latest attack on a federal judge.

By mid-afternoon, Trump had taken to Twitter to push back and dispute Roberts' claim about the independence of federal judges by focusing on his long-standing hostility to rulings from the US Court of Appeals for the 9th Circuit, which covers western states.

The unusual public dispute between the heads of two branches of the federal government came in the aftermath of a court ruling against the administration's new asylum policy from a federal district judge in California on Monday night.

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

The comments came less than 24 hours after Trump attacked a ruling against his latest asylum policy as having come from "an Obama judge."

Hours after news reports about Roberts' statement were published, Trump responded on Twitter — disputing Roberts' claim and taking aim at the 9th Circuit, as he had done in part of his Tuesday comments that led to Roberts' rebuke. Claiming that "the numbers" — referring to times its decisions are overturned by the Supreme Court — are "shocking," Trump wrote that the rulings "are making our country unsafe."

Sorry Chief Justice John Roberts, but you do indeed have “Obama judges,” and they have a much different point of view than the people who are charged with the safety of our country. It would be great if the 9th Circuit was indeed an “independent judiciary,” but if it is why......

.....are so many opposing view (on Border and Safety) cases filed there, and why are a vast number of those cases overturned. Please study the numbers, they are shocking. We need protection and security - these rulings are making our country unsafe! Very dangerous and unwise!

In the Monday ruling, US District Judge Jon Tigar issued a temporary restraining order halting enforcement of the Trump administration's new asylum policy, which would bar those who cross the southern border from seeking asylum in the United States unless they come into the country at a port of entry.

The next day, before leaving DC for Mar-a-Lago, his Florida resort, Trump called the US 9th Circuit Court of Appeals, where any appeal from Monday's ruling would initially be heard, a "disgrace." The court, which is the most liberal of the federal appellate courts, has regularly ruled against Trump's restrictive immigration policies, from the travel ban to his administration's efforts to end the Deferred Action for Childhood Arrivals (DACA) program.

"[Y]ou cannot win — if you're us — a case in the 9th Circuit and I think it's a disgrace," Trump told reporters. "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." He went on to say that practically "every case, no matter where it is" challenging Trump actions is filed in the 9th Circuit.

Of the asylum case specifically, Trump said, "This was an Obama judge. And I'll tell you what, it's not going to happen like this anymore."

Tigar was nominated to the federal bench in 2012 by President Barack Obama, after having served for a decade as a state court judge in California. He was confirmed by the Senate later that year by unanimous consent. This year, judges confirmed to federal district courts in California under Obama also blocked Justice Department grant restrictions aimed at so-called "sanctuary" cities and halted the Trump administration's efforts to terminate Temporary Protected Status for several countries.

But judges within the 9th Circuit who ruled this year in major cases challenging Trump's policies have been appointed by presidents of both parties.

On Nov. 8, a three-judge panel of the 9th Circuit — featuring two judges nominated by Obama and one nominated by former president Bill Clinton — upheld a lower court judge who ordered the administration to partially revive the Deferred Action for Childhood Arrivals program. US District Judge Dana Sabraw, appointed under former president George W. Bush, ordered the administration to reunite migrant families separated at the border. US District Judge John Coughenour, appointed under former president Ronald Reagan, was one of two Washington State judges to order the administration to resume funding for teen pregnancy prevention programs.

On the other hand, one Obama nominee, US District Judge Gonzalo Curiel, sided with the Trump administration this year in a legal fight over the administration's efforts to build a wall along the US–Mexico border. Curiel also presided over fraud litigation against Trump University, and Trump was heavily criticized during the campaign for his comments questioning Curiel's impartiality due to his ethnicity. Curiel was born in the United States and is the son of immigrants from Mexico.

Roberts' comments were first reported by the Associated Press.

UPDATE

Nov. 21, 2018, at 21:47 PM

This report was updated to include coverage of President Donald Trump's tweets.

Chris Geidner is a Supreme Court correspondent for BuzzFeed News and is based in Washington, DC.