The broad ruling was designed to deflect future attacks on gender-affirming care for kids.

In a scathing ruling describing Health and Human Services Secretary Robert F. Kennedy Jr. as an “unserious” and “unsafe” leader, a federal judge in Oregon issued an order that will protect doctors and hospitals, and the transgender kids they treat, from the federal crackdown on gender-affirming care.

On Saturday, US District Judge Mustafa T. Kasubhai ruled that Kennedy was acting illegally when he attempted last December to unilaterially cut off federal funding for healthcare providers treating kids with gender dysphoria. “Unserious leaders are unsafe,” Kasubhai wrote in his ruling, adding that Kennedy’s actions “caused chaos and terror for all those people and institutions of our great nation.”