A divided Supreme Court on Friday refused to allow the Trump administration to immediately enforce a new policy of denying asylum to those who illegally cross the U.S.-Mexico border.

Chief Justice John G. Roberts Jr., a conservative nominated by President George W. Bush, sided with the court’s four liberals in denying the request, which lower courts had stopped after finding it a likely violation of federal law.

For the first time on a contested issue, Justice Brett M. Kavanaugh, nominated by President Trump and confirmed in October after a brutal partisan battle, noted his agreement with the court’s other conservatives.

He and Justices Clarence Thomas, Samuel A. Alito Jr. and Neil M. Gorsuch — Trump’s other nominee to the court — would have granted the administration’s request to let the order go into effect.

The decision was about whether to lift a lower court’s stay of Trump’s new asylum regulation, not on the merits of his plan. The legal fight on that could return to the Supreme Court.

But the legal battle over the regulation had provoked a dispute between Roberts and Trump, after the president complained that an “Obama judge” had initially stopped the regulation. The chief justice issued a statement defending the judiciary’s independence.

As is often the case in such procedural matters, neither side in the 5-to-4 vote explained its reasoning.

A panel of the U.S. Court of Appeals for the 9th Circuit earlier this month kept in place a district judge’s decision that stopped the policy’s implementation, saying it was simply a way around specific language in federal law that allows all who enter the United States, regardless of where, to apply for asylum.

“Just as we may not, as we are often reminded, ‘legislate from the bench,’ neither may the Executive legislate from the Oval Office,” wrote Appeals Court Judge Jay S. Bybee, a conservative nominated by Bush, in the 2-to-1 decision.

Trump’s Nov. 9 proclamation barred asylum for anyone who crosses the U.S.-Mexico border between official ports of entry, a reaction to recent caravans of migrants from Central America.

Solicitor General Noel J. Francisco told the Supreme Court that the policy had important goals — “channeling asylum seekers to ports of entry for orderly processing, discouraging dangerous and illegal entries between ports of entry, reducing the backlog of meritless asylum claims, and facilitating diplomatic negotiations.”

The lower courts said federal law does not allow the president to make such changes. The statute says an asylum application must be accepted from any alien “physically present in the United States or who arrives in the United States whether or not at a designated port of arrival . . . irrespective of such alien’s status.”

Trump denounced U.S. District Judge Jon Tigar and the 9th Circuit when Tigar on Nov. 19 blocked the policy and later refused to immediately reinstate it. That brought the rebuke from Roberts:

“We do not have Obama judges or Trump judges, Bush judges or Clinton judges,” Roberts said in a statement released by the court’s public information office. “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.”

The administration argued that those who cross into the country illegally could still apply for asylum but that their illegal passage would be a reason to deny it.

A group of Republican former Justice Department officials, including two former acting attorneys general and a former director of the FBI, told the Supreme Court that would be just a clever way around the law.

In their brief, the former officials said the regulation “is inconsistent with the plain text and meaning” of the federal law. Congress would not have “swung the door open for potential asylum for those who entered illegally, while simultaneously authorizing the [executive branch] to slam that door shut at any time for any reason.”

Lee Gelernt of the American Civil Liberties Union, representing those challenging the regulation, praised the court’s decision to keep the stay in place.

“The Supreme Court’s decision to leave the asylum ban blocked will save lives and keep vulnerable families and children from persecution,” Gelernt said in a statement. “We are pleased the court refused to allow the administration to short-circuit the usual appellate process.”

The ACLU’s brief said the regulation was fundamentally unfair to those with legitimate asylum claims.

Evidence in the case, it said, showed that those “fleeing persecution are desperate and often unsophisticated, have no understanding of the option to apply for asylum at a port, are forced by gangs and others to enter away from designated ports of entry, or cannot realistically travel to such ports because of danger and distance.”

The case is Trump v. East Bay Sanctuary.