In a 4-4 split vote, the Supreme Court has affirmed the judgment of the Fifth Circuit Court of Appeals, which upheld the preliminary injunction issued by federal district court Judge Andrew Hanen in the case brought by Texas and 25 other states challenging the Obama administration’s attempt to give legal status and work authorizations to almost 5 million illegal immigrants.

After Congress repeatedly refused to pass the DREAM Act, which would have enabled illegal aliens brought to the United States as children to receive relief from deportation or removal proceedings, President Barack Obama decided to take matters into his own hands.

In 2012, the Obama administration created the Deferred Action of Childhood Arrivals program, enabling 1.7 million illegal aliens under 30 years old brought to the United States as children to apply for work authorization and deferred deportation. Then, in 2014, this program was expanded by, among other things, eliminating the age cap and increasing the term of deferred action and employment authorization from two years to three years.

The administration also created the Deferred Action for Parents of Americans program, conferring deferred action on illegal aliens whose children are U.S. citizens or lawful permanent residents, provided no other factors make deferred action inappropriate.

In addition to lawful presence, DAPA grants deferred action recipients benefits such as work authorizations, driver’s licenses, Social Security, and other government benefits, costing an estimated $324 million over the next three years, according to the district court.

Texas and 25 other states sued in federal district court, and in February 2015, the district court judge issued a preliminary injunction preventing the Obama administration from implementing the DAPA program. He found that the states were likely to succeed on the merits of their claims that DAPA violated the Administrative Procedure Act, the federal law governing the issuance of new federal regulations. The injunction was upheld by the Fifth Circuit Court of Appeals in November.

With the preliminary injunction upheld, the case will go back to the federal district court, which will determine how the case goes forward. In essence, however, this likely means that the DAPA program is dead at least for the remainder of the Obama presidency.

Even Obama once recognized that he lacked the authority to do what he ultimately attempted to do with the DAPA program.

This is a huge win for Texas and all of the 26 states that challenged the president’s unilateral rewrite of federal immigration law, and a substantial loss for the administration. At its core, this case underscores the importance of each branch of the federal government respecting the limits of its authority and of each branch working to keep the others in check.

Thursday’s ruling is also a victory for the separation of powers and limited government.

Even Obama once recognized that he lacked the authority to do what he ultimately attempted to do with the DAPA program, noting that he is “not the emperor of the United States” and that the president’s job is “to execute laws that are passed.”

Even though today’s decision did not decide the merits on the case, upholding the preliminary injunction takes the first step towards restoring the balance of power between the legislative and executive branches of government. Let’s hope this will curb any other “audacious executive action” the administration had planned in Obama’s final year as president.

Still unresolved in the case are sanctions recently imposed on the Justice Department by the district court judge, Hanen. He accused Justice lawyers of unethical conduct, lying to him repeatedly in court about whether the DAPA program was being implemented in violation of his injunction order (it was). He ordered Justice lawyers who practice in the 26 states in the lawsuit to undergo annual ethics training, among other things, as well as ordering the Justice Department to provide him (under seal) with the names of all of the illegal aliens who were given deferrals.

The Justice Department has appealed the sanctions order and Hanen has stayed his order until a hearing in August.