DeVos is named in the lawsuit in her official capacity as secretary of Education. She will not be personally responsible for paying the $100,000 in monetary sanctions, which will be paid by the government.

The judge ordered that the fine go to a fund held by the former Corinthian students’ attorneys. It’s meant to help defray the damages and expenses associated with the improper collection of the loans, she said. The judge ordered the government and the attorneys to come up with a plan for administering the fund.

"We're disappointed in the court's ruling," the Education Department said in a tweet on Thursday evening. "We acknowledged that servicers made unacceptable mistakes."

Mark Brown, the head of the department's Office of Federal Student Aid, said in a video posted online that there was no "ill-intent" by the department and that officials "have taken swift action to correct the mistake."

An Education Department spokesperson did not respond to a request for comment on whether the department planned to appeal the decision.

The Trump administration had asked the judge to avoid holding DeVos and the Education Department in contempt or imposing fines, arguing that the department had “been working diligently and in good faith to correct the errors.” The department said in a court filing that it appreciated the “gravity” of the situation.

Toby Merrill, the director of Harvard Law School’s Project on Predatory Student Lending, which represents the former Corinthian students in the lawsuit, praised the judge’s decision.

“It’s a rare and powerful action by the court to hold the secretary in contempt,” she said. “And it reflects the extreme harm that Betsy DeVos and the Department of Education have caused students who were already defrauded by a for-profit college.”

It’s highly unusual, but not unprecedented, for a federal judge to hold an agency head in contempt or issue fines.

In 2011, during the Obama administration, Interior Secretary Ken Salazar was held in contempt by a judge over a moratorium on oil drilling. In 2002, during the George W. Bush administration, Interior Secretary Gale Norton was held in contempt in a Native American land trust case. Both contempt findings were ultimately reversed by an appeals court.

DeVos earlier this month sparred about the possible contempt finding with Sen. Elizabeth Warren (D-Mass.), who called for the Education secretary’s resignation over the issue.

“Loan servicers made an error on a small # of loans,” DeVos tweeted at the time. “We know & we’re fixing it.” She also accused Warren of lying about the issue.

After the judge’s rebuke, the Education Department moved to reprimand several employees and also admonished the companies it hires to collect federal student loans, POLITICO reported earlier this month. The department has blamed much of the errors on those student loan servicing companies, though it admitted in a court filing last month that officials had been “negligent” in overseeing the companies.

The Education Department has said it is in the process of providing refunds to at least 3,200 of those borrowers who ended up making unnecessary payments. Some of the borrowers paid voluntarily after being incorrectly told they owed money. In other cases, the government erroneously seized borrowers’ federal tax refunds or wages.

On Thursday, Judge Kim also ordered the Education Department to provide a monthly status report on its attempts to comply with the order and send a notice to borrowers about the situation.

Kim said she was leaving open the possibility that if DeVos and the Education Department continue to violate her order she would "impose additional sanctions, including the appointment of a Special Master to ensure compliance with the preliminary injunction."

The contempt finding and sanctions arose out of an ongoing lawuit against DeVos over her policy that provides only partial loan forgiveness to some borrowers whom the Education Department determines were defrauded.

Kim has blocked DeVos from carrying out the partial loan forgiveness policy, ruling that the Education Department ran afoul of federal privacy laws in calculating the amount of relief. The Trump administration has appealed that ruling to the 9th Circuit, where it remains pending.

