(CNN) The 9th US Circuit Court of Appeals on Friday ruled in favor of the Trump administration, saying the Department of Justice could give preference in awarding grants to cities that would use the money to focus on illegal immigration, as the federal government prepares to seek out undocumented immigrants in raids this weekend.

The City of Los Angeles sued the Department of Justice because it did not receive any funding from the Community Oriented Policing Services grant program , which is aimed at initiatives to build trust between communities and law enforcement agencies. Los Angeles chose "building trust and respect" as its focus area and did not mention illegal immigration in its application because of its policy as a sanctuary city.

The panel of judges ruled that "because DOJ's scoring factors encouraged, but did not coerce, an applicant to cooperate on immigration matters, the panel also rejected Los Angeles's claims that DOJ's use of the factors infringed on state autonomy in a manner that raised Tenth Amendment concerns."

"DOJ did not exceed its statutory authority in awarding bonus points to applicants that selected the illegal immigration focus area," the judges wrote, arguing that "DOJ's determination that the techniques of community policing may be used to address this public safety issue (illegal immigration) was entirely reasonable."

Read More