A federal judge has temporarily blocked the Trump administration from obtaining sensitive medical records from healthcare institutions in New York City that provided gender identity care to minors in recent years.

The ruling from US District Judge Katherine Polk Failla is a significant blow to the administration’s ongoing nationwide criminal investigation into the provision of gender identity care, which numerous courts around the country have viewed as an improper fishing expedition because the government has struggled to identify potential crimes by providers.

Ruling from the bench on Wednesday, Failla, an appointee of former President Barack Obama, provisionally certified a class comprised of individuals who had received care from a New York City provider over the past six years. She also issued a temporary restraining order that bars investigators from obtaining the records, including through a grand jury subpoena that had been issued to NYU Langone Hospitals in recent weeks.

“The scope of information sought by the government here, which includes medical assessments, diagnoses, informed consent records, and revelation of plaintiffs’ transgender status, is significant,” she said, adding that that type of information is “squarely within the class of intimate materials warranting the strongest constitutional protection.”