Updated with a response from the Education Department.

A federal judge has banned the U.S. Department of Education from using earnings data to grant only partial student loan forgiveness to defrauded borrowers who attended defunct for-profit chain Corinthian Colleges.

The decision is rooted in Education Secretary Betsy DeVos’s decision in December to provide debt relief to former Corinthian students by comparing the average earnings of students in similar vocational programs. That earnings information is collected under gainful employment, a regulation that penalizes career-training programs for producing too many graduates with more debt than they can repay.

The Project on Predatory Student Lending at Harvard University, a legal services clinic, filed an injunction in March to stop the practice. The group has argued that the Education Department has no right to use the data, which is supplied by the Social Security Administration, for any purpose other than to evaluate vocational programs. What’s more, the attorneys say denying full relief to Corinthian students is illegal.

In a ruling late Friday, Magistrate Judge Sallie Kim of the U.S. District Court in San Francisco agreed that the Trump administration violated privacy laws by using Social Security Administration data to calculate loan forgiveness. The judge granted the injunction and ordered the Education Department to end all attempts to collect on the education loans of Corinthian students.

“When the Department disclosed to the Social Security Administration information about the applicants’ Social Security numbers and dates of birth from the Department’s files, that disclosure violated the Privacy Act,” Kim said in the 38-page ruling. She noted that the law has several specific exceptions that would have made the disclosure of such information permissible, none of which apply in this case.

The Education Department has said the use of the earnings data is fully consistent with its agreement with the Social Security Administration. Even if the agency is correct, the judge said privacy laws prevents the use of aggregate statistical data to make decisions concerning the “rights, benefits or privileged of specific individuals.” That creates a clear conflict with the Education Department’s use of the data to determine how much debt to forgive.

“We’re encouraged that the court recognized the Secretary’s discretion to establish a borrower defense claims process that determines compensation based on harm incurred by the borrower,” Liz Hill, a spokeswoman for the Education Department, said, in an email. “In implementing the Department’s programs, we are mindful of the Privacy Act’s requirements, and we will carefully review the court’s decision as we assess next steps.”

The court is considering whether to compel the Education Department to award full student loan forgiveness to Corinthian students. A hearing is schedule for June 4.

“This ‘average earnings rule’ is not only a theft of data, but more importantly, it is a fact-free attempt by the Department of Education to double cross borrowers who were scammed by Corinthian and then waited months or even years for the relief that the Department promised them,” said Noah Zinner, an attorney at Housing and Economic Rights Advocates, a legal aid group working with the Project on Predatory Student Lending on the case.

It’s been three years since Corinthian closed after the Education Department cut off its access to federal student aid for lying about its graduation and job placement rates. At the time, the for-profit chain was being investigated and sued by state and federal authorities for fraud, deceptive marketing and steering students into predatory loans. Despite the evidence against Corinthian unearthed by the Education Department, former students are still struggling to have their federal loans fully discharged.

A federal statute known as borrower defense to repayment gives the Education Department authority to discharge federal student loans when a college uses illegal tactics to persuade students to borrow money. Debt relief applications have piled up during the past year as the Trump administration refused to take action until education officials could fully review procedures instituted under President Barack Obama.

In December, DeVos announced the approval of 12,900 applications for student loan forgiveness and denial of 8,600 claims from former Corinthian students. She said applicants would receive full loan forgiveness if their earnings are less than 50 percent of those of their peers. If their pay is at or above that threshold, the department would provide relief on a sliding scale.

Critics said the model will create more hardship for people who have been victimized by unscrupulous schools, robbing them of their legal right to have their federal loans fully discharged.