A federal appeals court on Thursday allowed President Donald Trump to maintain control of National Guard troops deployed to Los Angeles, delivering a legal victory in his ongoing standoff with California Governor Gavin Newsom over immigration protest responses.

The unanimous decision by a three-judge panel of the 9th U.S. Circuit Court of Appeals halted a lower court ruling that had found Trump acted illegally by deploying soldiers without the governor's consent. The deployment marked the first time since 1965 that a president federalized a state's National Guard without state approval.

"It is likely that the President lawfully exercised his statutory authority," the court wrote. "Affording appropriate deference to the President's determination, we conclude that he likely acted within his authority in federalizing the National Guard."

The judges noted evidence presented by the Trump administration that described protesters "pinning down" federal officers and throwing "concrete chunks, bottles of liquid, and other objects," damaging federal buildings, and attacking a federal van. "The federal government's interest in preventing incidents like these is significant," the opinion stated.

Trump celebrated the ruling on Truth Social, writing: "BThe Judges obviously realized that Gavin Newscum is incompetent and ill prepared, but this is much bigger than Gavin, because all over the United States, if our Cities, and our people, need protection, we are the ones to give it to them should State and Local Police be unable, for whatever reason, to get the job done. "

Governor Newsom, who filed the lawsuit to block Trump's order, said in a statement that the court "rightly rejected Trump's claim that he can do whatever he wants with the National Guard and not have to explain himself to a court." He added, "The President is not a king and is not above the law."

U.S. District Judge Charles Breyer had previously ruled in Newsom's favor, writing that Trump had overstepped his legal authority. "The protests in Los Angeles fall far short of 'rebellion,'" Breyer wrote, referencing the federal statute that limits the president's power to situations of "rebellion or danger of a rebellion."