New York City reached a preliminary settlement in a federal class-action lawsuit over the Police Department’s trespassing-enforcement tactics in public housing developments, according to court papers filed this week.

Under the proposed settlement, filed in United States District Court in Manhattan, the city agreed to alter the way the police patrol inside public housing buildings, acceding to many of the demands of the plaintiffs, who argued that basic behavior in public housing had become subject to aggressive scrutiny and unwarranted trespassing arrests.

The decision to settle the case is the latest step in an effort by Mayor Bill de Blasio’s administration to conclude lawsuits involving police conduct that were pending from earlier years.

The settlement is subject to approval by Judge Shira A. Scheindlin. If the settlement is approved, it is expected to become part of a federal monitoring process ordered in a parallel case decided by Judge Scheindlin in 2013 over the department’s stop-and-frisk policies.