The Trump administration has agreed to largely pause the planned conversion of a warehouse in Roxbury, New Jersey, into an immigration detention center until after it conducts an environmental review of the property, according to new court filings in a federal case.

About two hours before a hearing in the case was scheduled to take place in Newark on Tuesday, the administration and the New Jersey attorney general’s office announced a settlement allowing federal officials to retrofit the site with security cameras and lighting, change locks at the facility and put up temporary fencing. But the filing stated the two sides have agreed no additional work will take place until after a full environmental review of the site is completed.

“This is the best possible outcome,” David Broderick, an attorney representing local activists opposed to the project, told a crowd of protesters at a rally outside the Newark courthouse Tuesday.

In a joint statement, Gov. Mikie Sherrill, New Jersey Attorney General Jennifer Davenport and Roxbury Mayor Shawn Potillo said they still believe the site is not appropriate for an immigration detention center.

“We’ve been clear from the beginning that [the U.S. Department of Homeland Security’s] proposed [Immigration and Customs Enforcement] detention facility in Roxbury will harm the community and won’t do anything to make us safer,” they said. “If DHS conducts a proper analysis, it will discover that this industrial warehouse is no place for a detention center.

"If DHS continues to plow ahead after conducting its further analysis, we will return to court to seek relief immediately.”

The Trump administration did not immediately respond to a request for comment on the agreement.

The Department of Homeland Security in February paid nearly $130 million for a 700,000-square-foot warehouse in the North Jersey suburb that it plans to convert into a 1,500-bed detention facility for migrants facing deportation proceedings.

The New Jersey attorney general’s office has argued in court papers that the Trump administration is violating federal laws, including the National Environmental Policy Act. The AG’s office has said the White House should have first conducted an environmental review and notified state and local officials before completing the warehouse purchase.

Tuesday’s filing said the two sides would meet within seven days of the environmental review taking place to discuss future proceedings. The state’s case remains ongoing.

The legal fight over the planned Roxbury facility is one of several court clashes around the United States over the Trump administration’s attempt to vastly expand the country’s detention center footprint. Along with the New Jersey project, the White House has plans to open new facilities in states including Georgia, Texas, Pennsylvania, Maryland, Arizona and Florida by the end of the year.

The local opposition to the Roxbury facility has been fierce and bipartisan.

The all-Republican Roxbury Township Council has condemned the project. Potillo and others on the seven-member Council have been vocal in arguing their town lacks the sewer and water infrastructure to support what the White House plans to be a 1,500-detainee facility.

The mayor has also criticized the Department of Homeland Security for its lack of communication with local officials as the purchase was being finalized in February. The White House paid previous owner Goldman Sachs and its partner more than double what the land was worth, according to the latest tax assessment for the property.

Roxbury officials have joined Democrat Sherrill’s administration in its lawsuit over the site.

Roughly 200 people gathered outside the courthouse Tuesday morning to hold a rally protesting the plans for the ICE facility.

Kathleen Carozza, who lives in neighboring Rockaway, came dressed as the Statue of Liberty, torch in hand.

“It’s heartbreaking what's happening to our neighbors. It's really heartbreaking, and it's not what the Statue of Liberty stands for, which is why I am dressed as her today,” Carozza told Gothamist, while holding back tears.

Roxbury resident Susannah Oliveri said she lives about a mile from the proposed site.

“I am morally opposed to the ICE detention facilities in any state and anywhere in the country, not just Roxbury,” she said. “I think that what is happening in this country is horrific and just inhumane.”