If the Attorney General of the United States is "amazed" at what just one federal judge can do, President Donald Trump may find himself being even more surprised during the rest of his time in office.
The federal judiciary quickly emerged as a stumbling block to the implementation of one of Trump's initial policy decisions during his first weeks in office: the imposition of a travel ban on visitors from seven predominantly Muslim countries.
Since then, the judiciary has remained a thorn in Trump's side on that issue as he approaches the end of his first 100 days in office.
And going forward, legal experts say, the judicial branch could become a primary counterweight, if not the primary counterweight, to Trump and his proposed policies.
That's particularly true now since the other branch of government, Congress, is currently controlled by the president's fellow Republicans.
The federal court system "has the capacity to be pretty powerful," said Gillian Metzger, a professor at Columbia Law School.
"We have a very legalistic system," Metzger said. "A lot of what the government does can be challenged in court."
Trump learned that to his displeasure, and sparked scores of lawsuits naming him as a defendant, soon after Jan. 27, the day he issued an executive order imposing a 90-day travel ban on citizens of Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen trying to enter the United States.
A day later, mass protests objecting to the order began nationwide. Later that night a federal judge in New York blocked the deportation of travelers from those countries who had already landed in the U.S. before the order took effect.
On Feb. 3, a federal judge in Seattle — who was appointed by Republican President George W. Bush and unanimously confirmed by the Senate — issued a decision that blocked Trump's ban nationwide.
Trump quickly lashed out at the judge, James Robart, on Twitter for that ruling.
Since then, Trump has seen the U.S. Ninth Circuit Court of Appeals reject his bid to reinstate the ban and seen another federal judge, in Hawaii, block a new version of the travel ban that the president issued in the hopes of avoiding legal challenges that stymied the first ban. The Hawaiian judge's decision applied nationwide.
Attorney General Jeff Sessions last week sparked a firestorm of criticism when he expressed his own frustration over the Hawaiian judge's actions and seemed to denigrate the Aloha State in the process.
"I really am amazed that a judge sitting on an island in the Pacific can issue an order that stops the president of the United States from what appears to be clearly his statutory and constitutional power," Sessions said.
Sessions should not have been surprised.
Like Congress, where Sessions served for decades as a senator from Alabama, the federal judiciary is one of the three branches of government, with the third being the executive
Since 1803, with the Supreme Court's decision in the case known as Marbury v. Madison, the federal judiciary has been understood to have the power of reviewing laws, treaties and regulations to determine if they conflict with previous laws or the U.S. or state constitutions.
Metzger, referring to the federal judge in Hawaii, noted, "This was certainly not the first time that a federal court, seeing unconstitutionally motivated action, enjoined it across the board."
Metzger said the Trump administration's suggestions that federal judges don't or shouldn't have the power to block his actions has raised "some concern" — as it has "when President Trump seems to question [judges'] integrity."
Trump did that in 2016 when he accused U.S. District Judge Gonzalo Curiel of being biased against the then-presidential candidate, who was being sued in connection with Trump University, because of Curiel's Mexican heritage.
Trump learned last week that Curiel has been assigned to hear the case of a 23-year-old who was deported to Mexico despite supposedly having protected status under the Deferred Action for Childhood Arrivals policy implemented by President Barack Obama.
In their criticisms of judges who rule against them, or who could rule against them, Trump and his surrogates may be harming their chances not only in current cases but also in future cases.
"Attacking judges is not a wise or prudential thing to do, and is likely to reinforce the judiciary's sense of responsibility [to ensure] he is abiding by the constitutional limits," said David Cole, the national legal director for the American Civil Liberties Union, which has filed a slew of suits challenging the travel ban.
Cole said judges are also likely to look more closely at cases that challenge Trump because of his suggestions that his actions are not reviewable.
"When he says to the courts, 'You can't review my actions,' he's basically writing them out of their scheme in the constitutional order," Cole said. "Courts don't take that lightly."
"It stiffens their spines."
Trump's mouth and that of his surrogates played a role in the travel-ban case, where lawyers who challenged the ban pointed to statements by then-candidate Trump calling for a total ban on Muslims entering the United States temporarily. And Rudy Giuliani, a former mayor of New York and friend of Trump, earlier this year said that Trump asked him to craft a ban that would be legal after stating his intention was to enact a ban on Muslims.
Metzger, the Columbia Law professor, said that if federal judges had not been aware of those statements, "I'm not sure you'd get the results" that have occurred in the courts.
In other words, Trump's travel ban might have been allowed to go forward without his history of planning a ban based on religion, and he might have crippled his ability to get any such ban approved by the courts going forward because they will be aware of the statements.
Metzger noted that the Hawaii judge and one in Maryland "concluded that the travel ban was still unconstitutionally motivated."
Earlier this month, a federal judge in Kentucky allowed a suit to proceed against Trump filed by three people who were attacked at a campaign rally last year. The judge said the trio might have a legitimate claim that Trump incited a riot by telling audience members, "Get 'em out of here," after protesters disrupted the event.
Last month, a lawyer for Bowe Bergdahl, the soldier charged in military court with deserting his post in Afghanistan, appealed a decision allowing that case to proceed.
Bergdahl's lawyers argue that Trump's statements that Bergdahl is a traitor who should be executed mean that the case should be dismissed because the comments have destroyed his ability to get a fair trial.
Trump could avoid hurting his chances in court if he is more careful about what he says — and tweets — in the future, limiting evidence that his opponents can raise in arguments against his policies.
"I think the question going forward is: Is Donald Trump going to learn from his mistakes, or is he going to repeat them?" Cole said.
"I'm not overly confident that he's a big learner, or even one likely to recognize his mistakes, much less admit his mistakes," Cole said.
Metzger said, "I expect his lawyers and his staff to learn from what is happening" in the courts.
"I don't know that President Trump either has great control over his tweets or would not think that maybe the benefit of it outweighs the cost," Metzger said.
Metzger expects more challenges to Trump in the court as executive branch agencies seek to implement changes in policies by altering administrative rules, as opposed to laws. Like the law, changes in rules are reviewable by courts.
"If the agencies don't take the time to build up the record and think about what they're doing instead of just doing it, politically they may be at risk of being reversed by the courts," she said.
Metzger said Trump has had one big victory in the courts so far in his young presidency: the approval of his nomination of Neil Gorsuch as a justice on the United States Supreme Court.
"That's an important one," she said.
During the next several years, Trump will get the opportunity to make additional appointments to the federal judiciary and pick people who align with him ideologically. Currently, 127 seats, or more than 14 percent of all 890 federal court seats, are vacant.
"There are a lot of open spots in the courts, and a lot of chances to make judicial appointments," Metzger said.
However, there is no guarantee that a president will prevail during a court case heard by a judge whom he appointed, or who was appointed by a president of the same political party.
Republicans still rue the day that President George H.W. Bush appointed David Souter to the Supreme Court, given Souter's tendency to vote with liberal members of the court before he retired in 2009.
And many Republicans can't forgive current Chief Justice John Roberts — a conservative appointed by President George W. Bush — for voting twice in favor of the Obama administration in cases that upheld key parts of the Affordable Care Act.
"Once you're on the bench, you have the power not to follow" the wishes of the president who appointed you, Metzger noted.