New York City, the federal government and an intervening group of black firefighters and applicants have reached an agreement in principle to settle the last pending claims of a hard-fought class action suit alleging intentional discrimination within the New York City Fire Department.

The settlement announced Tuesday will avert a bench trial on a claim that the fire department engaged in a pattern or practice of “disparate treatment” in employment.