Federal authorities have agreed to establish new policies governing the conduct of immigration officers during raids, including restrictions on how and when agents can enter private homes, the source of widespread ire and anxiety among immigrants.

The rules are included in a settlement that was approved by a Federal District Court judge on Thursday, concluding a six-year-old class-action lawsuit. The suit contended that in eight raids in 2006 and 2007, Immigration and Customs Enforcement agents, without court warrants or other legal justification, forced their way into the homes of Latino families on Long Island and in Westchester County.

“No longer will ICE agents have free rein to invade the homes of immigrants, especially Latino immigrants, and be as abusive as they want without any worry that they might be reprimanded,” said Juan Cartagena, president of LatinoJustice PRLDEF, an advocacy group in New York City that, along with the Center for Constitutional Rights and the private firm Winston & Strawn, represented the 22 plaintiffs.

The settlement also ordered the federal government to pay $1 million in damages and fees — $36,000 to each plaintiff and the rest to cover lawyers’ fees.