When the Supreme Court struck down President Biden’s $400 billion plan to forgive up to $20,000 in federal student loan debt for 43 million borrowers, the prospect of substantive debt relief appeared to vanish.

But then millions of borrowers received surprise notices that their federal student loans were being eliminated through other government relief programs. The Biden administration has wiped out loans totaling $127 billion for 3.6 million borrowers — the biggest wave of student debt cancellation since the government began backing educational loans more than 60 years ago.

The cost of that relief is ultimately borne by taxpayers. The Education Department is the largest lender for Americans who borrow for higher education, and 43 million borrowers currently owe the government $1.6 trillion. The government profits from the interest that borrowers pay, but loan defaults and canceled debts offset that. The system is projected to run at a loss in most years.

Many of the programs that the Biden administration is using have existed for years, sometimes decades, but were notoriously troubled, forcing borrowers to navigate complicated bureaucratic hurdles. By adjusting rules and temporarily waiving some requirements, Education Department officials have accelerated long-delayed relief. Here are the four largest programs being used to eliminate loan debts — and how five borrowers benefited from them.

In 2007, Congress passed a law intended to entice more college graduates into public service careers: Those who worked for government agencies or nonprofit organizations would, after 10 years of monthly loan payments, have their remaining federal student loan balance eliminated.

But the program’s complex rules turned it into a quagmire that rejected 99 percent of applicants — and an effort in 2018 to apply patchwork fixes became another debacle. In 2021, the Biden administration tried again to cancel student loan debt by temporarily bulldozing the program’s rules and crediting hundreds of thousands of borrowers for previously ineligible payments.

That finally worked. More than 230,000 people had their loans eliminated through a waiver system that ended last year, and many more gained credits that sped up their forgiveness date.

Derik Screen, 41, works as a business intelligence analyst at the University of North Carolina at Charlotte. To pay for the M.B.A. degree he earned in 2008 from the University of Phoenix, he took out loans totaling $39,000.

Mr. Screen signed up for an income-driven payment plan and began chipping away at the balance, but interest costs kept his balance ballooning. Last year, he learned about the Biden administration’s temporary waiver and realized that many of his past payments could qualify. He also discovered that he could get credit for the years he had spent working in the admissions office at his undergraduate alma mater, the Virginia Military Institute.

Consolidating his loans, assembling the paperwork and obtaining the needed certifications from both his current employer and his past one took dozens of hours. “It was very cumbersome — it really was,” Mr. Screen said. But in September, his persistence paid off: He received a letter notifying him that his $86,000 loan balance had been eliminated.

“That relief, it’s amazing, after so many years,” he said. “And the idea that after 10 years, your debt can triple — I know for a lot of people, it’s just a number they’ll never be able to pay.”

The Education Department hires loan servicers to collect borrowers’ monthly payments and help them navigate their repayment options. Watchdogs and auditors, including the department’s own inspector general, have repeatedly raised alarms about the servicers’ shoddy work and lax oversight.

One frequent complaint was that servicers would improperly place borrowers’ loans into forbearance, sometimes for years — during which interest kept accruing — and failed to guide borrowers toward income-driven options that could have sharply reduced their total payments.

Last year, the government announced a plan to address those problems by essentially wielding a giant eraser.

Income-driven payment plans are designed to eliminate any remaining balance after a set period of repayment, typically 20 years. Even for borrowers who never enrolled in those plans, the Education Department decided to count virtually any payment, for any amount, as a qualifying one — and it added to its tally many months in which borrowers made no payments at all because they had a long-term deferment or forbearance. The department chose to apply those adjustments automatically for all borrowers, no application needed.

The result was that hundreds of thousands of borrowers abruptly discovered that their loans had reached the 20-year mark and been eliminated. The first notification letters were sent on July 14.

That day, when Chris White, 40, got an email from the Education Department with the subject line “You’re eligible to have your student loan(s) forgiven!,” he didn’t believe it. Mr. White figured that this, like Mr. Biden’s quashed mass-cancellation plan, would be revoked, too.

“I remember thinking, specifically, it’s great to see that they’re still trying and they’re working at this, and that means a lot — but I, in no way, expected it to actually happen,” he recalled. “And then one day, I logged on to my loan servicer’s website, and it just said that my balance was zero.”

The maneuver freed Mr. White from $22,000 in debt he had for the bachelor’s degree in electrical engineering that he received from the University of Maine in 2007. He had spent several years working in the field but decided it was a poor fit and quit to pursue other trades. He is now a freight warehouse manager in Pembina, N.D.

Mr. White was especially surprised to have his loan forgiven because he had made payments on it intermittently — before the pandemic, his loan was in default — and some of the debt was less than 20 years old. But soon after he graduated, Mr. White had consolidated his loans. In calculating the adjustment, the Education Department counts any payment (or qualifying forbearance) on any debt in a consolidated loan toward the 20-year clock — and Mr. White had some loans dating back to 2001.

Chuck Ertel-Hoy, 72, retired in 2019 after 25 years of teaching communications at public universities — but he still owed $42,500 for a Ph.D. he earned in 1997 from the University of Tennessee.

Mr. Ertel-Hoy, who lives in Indianapolis, had tried for years to have his loans discharged through the public service loan forgiveness program, but he kept running into paperwork problems. He had just sent off yet more paperwork when the email arrived in July saying his loans would be forgiven through the income-driven repayment adjustment.

“It relieves a lot of pressure,” he said. Mr. Ertel-Hoy had been dreading the prospect of trying to squeeze $300 a month out of retirement savings to resume payment on his loans when the pandemic pause ended. “I’d thought, am I still going to have to pay on these student loans for the rest of my life?” he said.

In 2014, Corinthian Colleges — once one of the country’s largest for-profit college chains — collapsed. It was quickly followed by ITT Technical Institutes, another industry giant. Tens of thousands of mid-degree students were left stranded, and hundreds of thousands more were paying off loans for an often substandard education that failed to deliver on the career growth and earning potential the schools had advertised.

The debacle catalyzed a wave of grass-roots activism: Former students teamed with crusading lawyers to request relief through an obscure federal student loan provision, known as “borrower defense to repayment.” Students whose schools defrauded them, typically by breaking consumer protection laws, could seek to have their loans forgiven.

The Obama administration began to build a system for handling those requests, but it ground to a halt during the Trump administration. When Mr. Biden assumed office, tens of thousands of claims — some that had been languishing for as long as six years — were pending, and over 130,000 others had been summarily rejected.

In 2022, the Biden administration agreed to settle a class-action claim that covered 200,000 borrowers who had attended more than 150 schools. One of them is Sally Olsen, 64, who earned a bachelor’s degree in business management at American InterContinental University, a for-profit school whose owner paid $30 million to settle fraud charges brought by the Federal Trade Commission.

Ms. Olsen enrolled in 2004, but she was underwhelmed by her educational experiences there and overwhelmed by the debt it left her with: Nearly $110,000 in federal loans and tens of thousands more in private loans.

Ms. Olsen, an administrative assistant at an insurance agency in Bloomington, Ill., eventually paid off the private loans through a settlement, but the federal loans haunted her. Seeking help, Ms. Olsen — a former Marine — contacted Veterans Education Success, an advocacy group. Their representatives helped her file a borrower defense claim in 2021.

Legal challenges delayed the class-action settlement, but in May, Ms. Olsen finally got the news she had dreamed of: Her $70,127 federal loan balance had been eliminated.

“I think God finally heard my prayers, after all these years,” she said.

Borrowers who are permanently disabled are eligible to have their federal student loans eliminated. The process had long been a bureaucratic obstacle course, requiring doctors’ notes — which were often rejected, with little or no explanation, because of documentation errors — and years of income-monitoring and other compliance requirements. Many who would have qualified for relief never bothered to apply.

But two government agencies already had data on people who were fully disabled: the Social Security Administration and the Department of Veterans Affairs. By creating automatic data-matching programs with both agencies and eliminating some income documentation requirements, the Education Department significantly expanded the number of borrowers who gained relief.

Khen Reyes, 48, was medically discharged from the Navy last year after a military career that spanned four decades. It left him with post-traumatic stress disorder, anxiety and depression. The Department of Veterans Affairs determines the severity of service-related disabilities through a ratings scale; Mr. Reyes maxed out, at 100 percent.

In 1997, Mr. Reyes enrolled in an aircraft mechanics certification program at the Sierra Academy of Aeronautics. More than two decades later, he still owed just over $25,000 — a defaulted debt that had prevented his wife and him from obtaining a V.A. home loan. Armed with his military discharge papers and his disability documentation, he sought to have his loan eliminated.

Late last year, Mr. Reyes, who lives in Foster City, Calif., checked his loan servicer’s website and saw a $0 balance.

“Other service members are in a similar boat as me,” he said. “I want service members to know, this is about accepting something that you worked hard for. I don’t have any shame that I used this resource. If there’s a program that helps us, oh my God, by any means — use it.”