A federal appeals court has ruled that the Trump administration is within its rights to reward cities who obey the law and cooperate with ICE, specifically involving deportations of illegal aliens.

The city of Los Angeles sued the Trump administration, claiming it was being treated “unfairly” and claimed it was being coerced into helping ICE.

The city said it missed out on $3 million in grant money because Los Angeles didn’t give ICE access to local jails and failed to focus on illegal immigration on an application, The Hill reported.

But the 9th U.S. Circuit Court of Appeals ruled on Friday that the Trump administration could reward cities with grant money if they cooperate with ICE or use the funds to strengthen emigration enforcement, The Washington Times reported.

WesternJournal reports: The grants mentioned are known as the Community Oriented Policing Services grants, which were created in 1994 to give extra money to local authorities to put more police officers in local communities.

However, in a 2-1 decision, the federal appeals court dismissed the city of Los Angeles’ claim and asserted the Trump administration isn’t coercing anyone.

“The panel rejected Los Angeles’s argument that DOJ’s practice of giving additional consideration to applicants that choose to further the two specified federal goals violated the Constitution’s Spending Clause,” George W. Bush appointee Judge Sandra Ikuta wrote.

“The panel held that DOJ did not exceed its statutory authority in awarding bonus points to applicants that selected the illegal immigration focus area or that agreed to the Certification,” she added.

However, Bill Clinton appointee Judge Kim Wardlaw dissented, saying the COPS grants were “Orwellian.”

“The majority goes astray by finding no meaning in Congress’s use of the term ‘community-oriented policing’ and then deferring under Chevron to DOJ’s Orwellian effort to define ‘community-oriented policing’ to include ‘partnering with federal law enforcement to address illegal immigration,’” Wardlaw wrote.

“Congress did not authorize COPS grants for anything other than placing additional state and local cops on the beat and promote community partnerships,” she added.

White House press secretary Stephanie Grisham said, “This ruling reverses a lawless decision that enabled sanctuary city policies, putting the safety and security of all Americans in harm’s way.”

While previous attempts have been made to withhold money from grant programs who fail to comply with ICE, this is the first time a court has ruled in favor of the Trump administration’s attempt to reward cities who comply, The Washington Times reported.

Ikuta said, “Los Angeles may believe that addressing illegal immigration is not the most effective way to improve public safety, but the wisdom of DOJ’s policy is not an element of our arbitrary and capricious review.”

It’s no secret that President Donald Trump has been a longtime critic of sanctuary cities.

Earlier this year, Trump said he was “giving strong considerations” to placing illegal immigrants in sanctuary cities.

“The Radical Left always seems to have an Open Borders, Open Arms policy – so this should make them very happy!” he wrote on Twitter.