Attorney General Bill Barr can implement President Donald Trump’s decision to withhold federal funding from “sanctuary cities” that attempt to thwart federal immigration laws, the Ninth Circuit appeals court ruled on Friday.

The Trump administration is denying some federal law enforcement grant money to sanctuary cities. Los Angeles challenged that decision in federal court, arguing that the decision violates federal law and limits on Congress’s authority under the Spending Clause of the U.S. Constitution.

A 1994 federal law authorizes the Department of Justice (DOJ) “to provide a range of federal assistance to state and local law enforcement,” Judge Sandra Ikuta wrote on Friday, describing DOJ’s administering “a competitive grant program that allocates a limited pool of funds.”

“In 2017, Los Angeles applied for a grant, but failed to score highly enough to earn one,” Ikuta continued for the three-judge panel of the U.S. Court of Appeals for the Ninth Circuit.

Congress’s law “linked to the goal of enhancing the crime prevention function of state and local law enforcement through working with the community,” the San Francisco-based court continued. Federal law at 34 U.S.C. § 10388 authorizes DOJ to “promulgate regulations and guidelines to carry out” the grant program to achieve the program’s goals.

“The Application Guidelines set out a series of questions and instructions that allow an applicant to explain why it is seeking a grant and why it is best qualified to receive one,” wrote Ikuta. “Among other things, an applicant must explain its need for federal assistance, provide information about its fiscal health, agree to comply with various provisions of federal law, and provide additional information and assurances of various kinds.”

“DOJ evaluates, scores, and ranks the submitted applications, then awards grant funds to the highest scoring applicants,” the opinion noted. “The scoring process is designed to allocate federal assistance to programs, focuses, or conduct that DOJ deems to best further statutory purposes and federal goals.”

The court noted that applicants received extra points for making illegal aliens an enforcement priority, and still more points for agreeing to the Certification of Illegal Immigration Cooperation.

“The question before us, therefore, is whether DOJ’s scoring practice of giving these additional points is unconstitutional or exceeds DOJ’s authority in administering the grant program,” the panel explained.

The Spending Clause found in Article I, Section 8, Clause 1 of the Constitution authorizes Congress “to pay the Debts and provide for the common Defence and general Welfare of the United States.”

This power gives Congress the ability “to grant federal funds to the States, and Congress may condition such a grant upon the States taking certain actions that Congress could not require them to take,” wrote the Ninth Circuit, quoting Supreme Court precedent.

“Although Congress has broad power to attach conditions to the receipt of federal funds, the power is not unlimited,” Ikuta noted, quoting Supreme Court cases holding that “the exercise of the spending power must be in pursuit of the general welfare,” and that Congress must impose any such restrictions “unambiguously.”

“Nor can the federal government attach conditions to the receipt of federal funds if “the financial inducement offered by Congress might be so coercive as to pass the point at which pressure turns into compulsion,” she added. “Further, Congress may not impose conditions on federal grants that are unrelated to the federal interest in particular national projects or programs.”

“Finally, Congress may not require states to engage in actions that are themselves unconstitutional,” the appellate court noted.

In this context, only one of those requirements is implicated, so the constitutional test here is whether federal agencies “offer a financial inducement for an applicant to cooperate on illegal immigration issues that is so coercive that it is tantamount to compulsion,” she explained.

The Ninth Circuit found that agreeing to these illegal alien policies was not a make-or-break point on receiving federal grant money. “Rather, an applicant is free to choose one of many focus areas, and numerous applicants obtained funding without selecting illegal immigration or signing the Certification,” the panel noted.

“We conclude that DOJ did not exceed its statutory authority in including two scoring factors related to illegal immigration as part of its implementation of the grant program,” the court held.

The Ninth Circuit likewise rejected Los Angeles’s statutory arguments, holding that DOJ’s determinations were not “arbitrary and capricious,” and therefore that the Trump administration has fully complied with the Administrative Procedure Act.

Ikuta’s opinion was joined by Judge Jay Bybee, both appointed by President George W. Bush. Judge Kim Wardlaw dissented.

This case might not be over in the Ninth Circuit. Given that this was a 2-1 conservative panel on a notoriously liberal court, Los Angeles could petition the appeals court to rehear the case en banc.

The Ninth Circuit is so absurdly large that when it rehears a case en banc, rather than all 29 judges hearing the case, the en banccourt consists of 11 judges: the chief judge (currently a strident liberal, Sidney Thomas), plus 10 judges chosen as random.

Regardless of whether the final Ninth Circuit decision is the panel decision or an en banc decision, the Supreme Court is likely to grant review of the case.

The case is City of Los Angeles v. Barr, No. 18-55599 in the U.S. Court of Appeals for the Ninth Circuit.

Ken Klukowski is senior legal analyst for Breitbart News. Follow him on Twitter @kenklukowski.