The U.S. Supreme Court on Friday dealt a setback to President Donald Trump by refusing to allow his administration to implement new rules prohibiting asylum for people who cross the U.S. border illegally, with conservative Chief Justice John Roberts joining the four liberal justices in denying the request.

The justices on a 5-4 vote rebuffed the Trump administration's request to put on hold a California-based federal judge's order, at least temporarily preventing it from carrying out the policy intended to make anyone crossing the U.S.-Mexican border outside of an official port of entry ineligible for asylum.

The planned asylum change was a key component of Trump's hardline policies aimed at making it tougher for immigrants to enter and stay in the United States.

Roberts, who last month rebuked Trump over his criticism of the judiciary, joined liberal Justices Ruth Bader Ginsburg, Stephen Breyer, Elena Kagan and Sonia Sotomayor against the administration. Trump's two high court appointees, Brett Kavanaugh and Neil Gorsuch, joined the two other conservative justices, Clarence Thomas and Samuel Alito, in dissent.

"The Supreme Court's decision to leave the asylum ban blocked will save lives and keep vulnerable families and children from persecution. We are pleased the court refused to allow the administration to short-circuit the usual appellate process," said Lee Gelernt, a lawyer for the American Civil Liberties Union, which challenged Trump's policy.

San Francisco-based U.S. District Judge Jon Tigar blocked the policy on Nov. 19. The San Francisco-based 9th U.S. Circuit Court of Appeals then refused the administration's request to lift Tigar's order.

Supreme Court Chief Justice of the U.S. John Roberts joined the four liberal justices in denying the request. (Jabin Botsford/The Washington Post via AP)

Tigar's ruling prompted Trump to call the jurist an "Obama judge" and blast the 9th Circuit in general as a "disgrace." Tigar was appointed to the bench by Democratic former President Barack Obama.

Trump's comments led to an extraordinary response from the normally reticent Roberts, who defended the independence of the federal judiciary and wrote in a public response to Trump on Nov. 21, "We do not have Obama judges or Trump judges, Bush judges or Clinton judges."

The port-of-entry restrictions, due to expire after 90 days, were made through a presidential proclamation Trump issued on Nov. 9 alongside a new administration rule. The administration has sought ways to block thousands of Central American men, women and children travelling in caravans to escape violence and poverty in their home countries from entering the U.S., with Trump calling the people in the caravans a national security threat.

A migrant, part of a caravan of thousands from Central America trying to reach the United States, climbs the border fence between Mexico and the U.S. in Tijuana, Mexico, in November. Illegal crossings at the southern border have dropped dramatically since the late 1970s. (Hannah McKay/Reuters)

Illegal crossings at the southern border have dropped dramatically since the late 1970s, but in recent years, applications for asylum have ballooned and more Central American families and unaccompanied children are migrating to the U.S.

Trump's proclamation stated that mass migration on the border had precipitated a crisis, and he was acting to protect the U.S. national interest. Trump's policy was crafted to alter American asylum laws that have given people fleeing persecution and violence in their homelands the ability to seek sanctuary in the U.S.

The Supreme Court in June backed Trump in another major immigration-related case when the justices in a 5-4 ruling endorsed the legality of the Republican president's travel ban on people from several Muslim-majority nations. Roberts joined the court's other conservatives in that ruling.

On Wednesday, a different judge blocked another of Trump's asylum-related orders, this one aimed at restricting asylum claims by people citing gang or domestic violence in their home countries.