The American Federation of Teachers said Wednesday that it has secured a settlement with the U.S. Education Department that could serve as the legal backbone for a spate of changes to a loan forgiveness program for public servants.

The agreement resolves a 2019 lawsuit the teachers union filed against then-Education Secretary Betsy DeVos and the department alleging gross mismanagement of the Public Service Loan Forgiveness program. It affords teachers, firefighters, nurses and other public servants who have been denied cancellation a case review by the Education Department and credit for years of past payments.

Those provisions align with the Biden administration’s initiative to bring more than 550,000 people working in the public sector closer to debt cancellation by crediting past payments and reconsidering rejected applications. American Federation of Teachers President Randi Weingarten said the legally binding settlement will now give teeth to Biden’s temporary measures.

“Our settlement is the muscle, is the enforcement mechanism for a lot of the changes the department talked about last week,” Weingarten said on a call with reporters Wednesday. “It is also how you make sure that this happens in a proactive, forward-facing way.”

Two years ago, AFT joined educators in suing the department for allegedly ignoring complaints that loan-servicing companies it hired were providing bad advice and making mistakes that kept borrowers from receiving debt relief. The lawsuit highlighted long-standing issues in a loan forgiveness program that consumer groups and lawmakers say is unnecessarily complicated and poorly run.

Congress created Public Service Loan Forgiveness in 2007 to entice college graduates to go into teaching, law enforcement and other public service jobs. The rules require borrowers to have received loans directly from the federal government, but until 2010, most federal loans were originated by private lenders. Applicants must also be enrolled in certain repayment plans, primarily those that cap monthly loan payments to a percentage of borrowers’ income. But most of those plans emerged only in recent years.

A 2018 Government Accountability Office audit found the Education Department provided insufficient guidance to its servicer and borrowers about which types of employment, federal loans and repayment plans qualify for the program.

Participants say loan servicers led them to believe they were making qualifying payments when they were not, processed payments incorrectly or botched paperwork. Many have complained of not learning of these problems until they were nearing the end of the program or after their application was denied.

Peter Huk, one of the plaintiffs in the union lawsuit and a writing instructor at the University of California at Santa Barbara, said he discovered that he was in an ineligible repayment program after eight years of misleading advice from his servicer. It was not until he submitted a form to verify his employment that he learned of the error, Huk said.

“I was told: ‘Well, you did it all wrong. Just start over.’ What do you mean, ‘Just start over’? My hope went to hopelessness,” Huk said. “I felt a lot of anger because of the lies I was told by these loan servicers. I’m still shedding the frustration and trauma.”

Fellow plaintiff Debbie Baker, a choir teacher in Tulsa, said she routinely checked in with her loan servicer and was assured she was on track for forgiveness. She later learned her loans that were originated through the now-defunct Federal Family Education Loan Program were actually ineligible. By then, as interest accrued, Baker had paid twice as much as she originally owed. She contacted the department and government officials but said it seemed as if no one cared.

“This is a day I never thought would come,” Baker said Wednesday. “It’s life-changing to be able to go to school, teach every day and not have to deal with the anxiety ... of being trapped by debt.”

Under the settlement, the Education Department will cancel the remaining balances of the eight plaintiffs, amounting to nearly $400,000 of debt, by the end of January.

While the workers sought cancellation of their loans, the union set out to get the Education Department to create a robust appeals process and a system to identify and account for servicing errors. To that end, the department has agreed to give all borrowers a detailed review of their rejected applications and allow borrowers to submit evidence in support of their claim.

In a statement, Education Department spokeswoman Kelly Leon said the department is “pleased to settle this litigation and [looks] forward to working with organizations” to improve the loan forgiveness program.

“For too long, Public Service Loan Forgiveness has failed to live up to its promise of debt relief to our nation’s public service workers,” Leon said. “The Biden-Harris Administration takes that promise seriously and is already making the changes necessary to remove the burden of student debt on those who serve our communities and our country.”