Most of the “sanctuary cities” that President Trump threatened would not get law-enforcement grants have received or been cleared to receive the money after all, the Justice Department said.

Courts have chipped away at the crackdown that escalated in 2017 with letters from former Attorney General Jeff Sessions to 29 cities, metro areas, counties or states it considered had adopted “sanctuary policies,” saying those policies may violate federal law.

Of those 29 jurisdictions — which include cities as large as Los Angeles and as small as Burlington, Vt. — only Oregon has yet to be cleared to receive the grants from 2017, a Justice Department spokesman said last week.

New York City’s grant money was freed up in November by a district court judge who ruled that the Justice Department’s restrictions infringed on the city’s “sovereign authority.”

Similar cases are being litigated across the country, and the DOJ Department is considering appealing some rulings.

Trump says that places that don’t cooperate with federal immigration authorities pose a threat to public safety.