(Bloomberg) -- When it comes to Donald Trump, the U.S. Supreme Court apparently is as divided as the rest of the country.
In upholding the president’s travel ban Tuesday, five Republican-appointed conservatives were willing to overlook Trump’s pointed comments about Muslims and afford him the deference presidents typically get on border control and national security issues. Four Democratic-appointed liberals weren’t.
It’s the kind of stark divide Chief Justice John Roberts says he prefers to avoid, and sometimes can. A year ago the court managed to defer a showdown over an earlier version of the policy, letting it take partial effect without ruling directly. But on Tuesday the justices were unable to smooth over their differences, opening themselves to criticism in the process.
"It looks like Trumpism has infected the Republican appointees on the court, much in the way that it has infected Congress," said Michael Dorf, a constitutional law professor at Cornell. "They look very much like the president’s Republican critics in Congress, who condemn Trump’s most outrageous positions but enable his policies."
The ruling was one of the last of the court’s nine-month term. The justices will issue their final opinions Wednesday, including a ruling on mandatory union fees paid by public-sector workers. That case also could expose their ideological divide.
In his majority opinion, Roberts pointed to the broad powers Congress has given the president to control the nation’s borders. He said that the travel ban fell "squarely within the scope of presidential authority" under the federal immigration laws and that the government was pursuing a "legitimate national security interest."
As for Trump’s religiously tinged comments -- including his campaign statement that "Islam hates us" and call for a "total and complete shutdown of Muslims entering the United States" -- Roberts had little to say.
"The issue before us is not whether to denounce the statements," Roberts wrote. "It is instead the significance of those statements in reviewing a presidential directive, neutral on its face, addressing a matter within the core of executive responsibility."
The ruling drew a sharp dissent from Justice Sonia Sotomayor and a more calibrated one from Justice Stephen Breyer.
Speaking from the bench, Sotomayor said Trump had repeatedly denigrated Islam, both before and after his inauguration, and had never disavowed the comments.
“Take a brief moment and let the gravity of those statements sink in,” she said.
Sotomayor’s written dissent for herself and Ginsburg also cited "stark parallels" with the internment of Japanese-Americans during World War II, a policy allowed by the court in a 1944 ruling known as Korematsu.
Justice Anthony Kennedy, in a separate opinion concurring with the majority, said the court’s ruling doesn’t insulate government officials from a duty to respect religious and speech rights.
"It is an urgent necessity that officials adhere to these constitutional guarantees and mandates in all their actions, even in the sphere of foreign affairs," Kennedy wrote in an opinion that no other justice joined.
Trump’s ban in its current form affects seven countries, five of them predominantly Muslim, and indefinitely bars more than 150 million people from entering the country.
The travel-ban divide was in one sense unremarkable. The court has divided 5-4 on some of the country’s most difficult issues in recent years, covering gay marriage, campaign finance regulations, abortion and voting rights. A disproportionate number of those rulings have come in the final days of the court’s nine-month terms.
"It is unfortunate when high-profile cases break down in this way," Rick Garnett, a constitutional law professor at the University of Notre Dame, said in an email. But "if we ask the Supreme Court to answer all of our controversial and hot-button cases, and we have increasingly ideological nominations processes and confirmation fights, it should not be surprising that we see (from time to time) these results."
In another sense, however, the travel ban ruling was different. It marked the court’s first direct pronouncement on Trump’s aggressive -- and divisive -- presidency.
It also came with the crucial majority vote of Justice Neil Gorsuch, the Trump nominee whose appointment was possible only because Senate Republicans blocked President Barack Obama’s nomination of Merrick Garland to fill a vacancy in 2016.
Underscoring the political dynamic, Senate Majority Leader Mitch McConnell implicitly took credit for the decision. Moments after the court released the ruling, McConnell’s campaign tweeted a picture of him shaking hands with Gorsuch.
Democrats said they shared that assessment. "The full consequences of Republicans’ unprecedented theft of a Supreme Court seat are just now becoming clear," Democratic Senator Jeff Merkley of Oregon tweeted.
McConnell, a Republican from Kentucky, told reporters the travel ban upheld by the court was an improvement over the original version, which sparked airport chaos when Trump put it in place a week after taking office last year.
"I think the administration finally got it right," he said. "The Supreme Court agreed with that. And I think this is a decision the president should feel good about."
At one point, the travel ban case offered the prospect of something other than a 5-4 ruling. When the court in December let the policy take full effect while the fight played out, Breyer and Justice Elena Kagan didn’t publicly dissent. The two often work with Roberts and Kennedy to build bridges.
Breyer and Kagan dissented Tuesday but without joining Sotomayor’s sweeping opinion. They said they would have returned the case to a lower court to look more closely at the procedures for granting individual waivers from the ban, while blocking the policy in the meantime.
"I have to assume the chief justice would have preferred a 7-2 ruling," Garnett said. "And, as I read it, the case feels more like 5-2-2 than 5-4 because the two dissents are so different in tone and content."
Even so, Elizabeth Wydra, president of the progressive Constitutional Accountability Center, called the ruling a blow to the court’s institutional standing.
"The court majority not only abdicated its institutional role as a check on the executive but also fed into the idea that the justices are merely politicians in robes," Wydra said.
©2018 Bloomberg L.P.