Updated

The U.S. Justice Department may no longer withhold grants from Chicago as leverage against its policies of providing sanctuary to immigrants, a federal judge ruled Friday.

The city filed a lawsuit against Attorney General Jeff Sessions in August 2017 after the DOJ required Chicago and other sanctuary cities to provide 48 hours’ notice before releasing from custody immigrants who entered the U.S. illegally, the Chicago Sun-Times reported.

The Justice Department also sought access to jails by federal agents and the sharing of citizenship information.

U.S. District Judge Harry Leinenweber granted a permanent injunction against the three conditions and denied a Justice Department motion to dismiss the lawsuit.

Sessions warned Chicago that it would be ineligible for federal public safety grants if it didn’t comply – a move the city maintained was overreach of legal authority and unconstitutional.

"Today’s opinion in favor of Chicago and against the Trump Justice Department marks a major win for all Chicagoans and a significant victory for public safety."

— Chicago Mayor Rahm Emanuel

“Today’s opinion in favor of Chicago and against the Trump Justice Department marks a major win for all Chicagoans and a significant victory for public safety," Chicago Mayor Rahm Emanuel said Friday.

According to the court’s order, the limitation will remain in place until an appeals process will determine whether the injunction applies nationwide, the Sun-Times reported.

Arguments are scheduled for Sept. 6.

The Associated Press contributed to this report.