The Supreme Court on Friday rejected President Biden’s plan to forgive millions of student loans, ruling the nation’s chief executive did not have legal authority to waive more than $400 billion owed to the government.

The Biden administration had asserted its right to cancel the loans as part of its emergency response to the COVID-19 pandemic and under a 2003 law called the HEROES Act, passed at the time of the Iraq War.

By a 6-to-3 vote in Biden vs. Nebraska, the court’s conservatives said that only Congress could authorize such a large- scale cancellation of government-provided loans, and it had not done so.

Writing for the majority, Chief Justice John G. Roberts Jr. said, “The HEROES Act allows the secretary to ‘waive or modify’ existing statutory or regulatory provisions applicable to financial assistance programs under the Education Act, but does not allow the secretary to rewrite that statute to the extent of canceling $430 billion of student loan principal.”

In dissent, Justice Elena Kagan wrote: “In every respect, the court today exceeds its proper, limited role in our nation’s governance… The result here is that the court substitutes itself for Congress and the executive branch in making national policy about student-loan forgiveness.”