The U.S. Court of Appeals for the Second Circuit on Wednesday threw out a lawsuit by four Black New York City firefighters, who claimed the department had unlawfully discriminated against them by denying their request for a medical accommodation to grow facial hair.

The decision, from a unanimous three-judge panel of the Manhattan-based appeals court, found that the FDNY could not be held liable for adhering to a binding federal safety regulation that required firefighters to be clean-shaven in areas where a respirator would fit to their faces.