It’s the court conservatives love to hate. And the Ninth U.S. Circuit Court of Appeals’ impending decision on whether to reinstate President Trump’s ban on entry to the United States by anyone from seven mostly Muslim countries may give the right a new reason not just to detest the nation’s largest appellate court, but to try to break it up.

The San Francisco-based, nine-state circuit has been a Republican target for decades, ever since an influx of Jimmy Carter appointees in the late 1970s transformed it from a relatively conservative court to a liberal tribunal that was regularly overruled by the U.S. Supreme Court.

One decision the high court struck down was the Ninth Circuit’s ruling in 2002 that it was unconstitutional to require children to recite “one nation under God” in the Pledge of Allegiance. Other overturned rulings from the court would have given terminally ill patients a constitutional right to die and allowed people to use marijuana for medicinal purposes without violating federal law.

The case heard Tuesday by a three-judge panel could also prove incendiary. Lawyers for Trump are challenging a federal judge’s ruling Friday that blocked the president’s executive order halting all U.S. travel for 90 days by anyone from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen, and all U.S. admission of refugees for 120 days. Refugees from Syria would be banned indefinitely.

If the court rules against Trump and leaves Seattle U.S. District Judge James Robart’s restraining order in place — a likely outcome, based on judges’ comments at the hearing — it could add partisan fuel to newly introduced legislation to split the Ninth Circuit.

“The more controversial rulings that come out of the Ninth, the stronger (supporters of a breakup) think they can make their argument,” said Carl Tobias, a University of Richmond law professor. “It’s hard to think there can be something more controversial than this.”

Trump seemed to be anticipating a judicial rebuff. After deriding Robart, an appointee of President George W. Bush, as a “so-called judge” in a Twitter post, Trump took aim at the Ninth Circuit on Wednesday.

“If these judges wanted to — in my opinion — help the court in terms of respect for the court, they’d do what they should be doing,” Trump told the National Sheriffs’ Association. “I mean, it’s so sad.”

On Twitter, the president wrote, “If the U.S. does not win this case as it so obviously should, we can never have the security and safety to which we are entitled. Politics!”

Trumps’s campaign appeared to be testing the patience even of some of his allies. His Supreme Court nominee, Neil Gorsuch, described the president’s attacks on the judiciary as “demoralizing” and “disheartening,” a spokesman for the confirmation team told reporters.

Still, if the Ninth Circuit panel rules against Trump’s order, its decision will be greeted in conservative circles with groans of “there they go again,” said Arthur Hellman, a University of Pittsburgh law professor and a longtime authority on the Ninth Circuit, whose central legal staff he once headed.

However, many conservatives’ favored solution to the perceived problem — splitting up the court — has been proposed and failed in the past. Legal commentators said the latest such measure faces an uphill battle, despite Republicans’ political gains.

“Breaking up the Ninth Circuit has got to be pretty low on the priority list of what Republican majorities in Congress and the president want to accomplish in the next couple of years,” said Scott Dodson, a law professor and associate dean at UC Hastings College of the Law in San Francisco. “I can’t see it going anywhere.”

The new legislation by Sens. Jeff Flake and John McCain, both Arizona Republicans, would place Arizona, Nevada, Montana, Idaho, Washington and Alaska in a new 12th Circuit Court of Appeals, leaving California, Oregon and Hawaii in a trimmed-down Ninth Circuit.

Flake, whose break-up legislation last year got nowhere, says he’s motivated by judicial efficiency, not politics. The Ninth Circuit, which hears about one-fifth of the nation’s federal appeals, also has the longest waiting times, taking an average of just over 14 months from hearing to decision.

“The oversized and overburdened Ninth Circuit has Arizonans waiting too long for justice,” Flake said in a statement. “Establishing a new circuit with stronger local, regional and cultural ties will ease the burden across the West.”

It would also put Arizona and five other states in a new circuit that, over time, would probably become more conservative. The judges would initially come from the current Ninth Circuit, but Trump would fill any vacancies that arose, and the Senate Judiciary Committee has given home-state senators veto power over court nominees. In the six states that would make up the new appeals court, most of the senators are Republicans.

Hellman said two smaller courts probably wouldn’t handle cases any faster than one large one. The Flake-McCain bill would transfer 10 of the Ninth Circuit’s 29 judicial positions to the new court, which roughly corresponds to the states’ share of the current caseloads. But speedups would require more judges, said Hellman, who noted that the much smaller circuits based in Washington, D.C., and Boston have waiting times nearly as long as the San Francisco court.

One reason federal appeals courts were designed to cross state lines, Hellman said, was that “different legal traditions made the circuit much stronger.”

With few exceptions, the court’s judges have preferred to keep the circuit intact. Court-splitting legislation in 2005 that cleared the House but died in the Senate drew strong opposition from jurists led by Chief Judge Mary Schroeder, a Carter appointee, and Alex Kozinski, a Ronald Reagan appointee who succeeded Schroeder as chief judge in 2007.

Opponents have also included Sen. Dianne Feinstein of California, now the top-ranking Democrat on the Senate Judiciary Committee. If a circuit-splitting bill reached the Senate floor, Democrats could mount a filibuster, which would require 60 votes — including at least eight Democrats — to defeat.

And although a ruling against Trump’s travel ban could energize the circuit-splitting movement, Tobias, the University of Richmond law professor, said the effect might be short-lived. The Trump administration would appeal any such ruling to the Supreme Court, which — with only eight members since the death of Antonin Scalia last February — would most likely split down the middle, letting the ruling stand, Tobias said.

“That should throw a wet blanket on the claim” of a biased Ninth Circuit, he said.

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com

Twitter: @egelko