The US Supreme Court is seen in Washington, DC, on June 26, 2022.
CNN  — 

The US Supreme Court said in a 5-4 ruling Wednesday that state agencies are not immune from private lawsuits under a federal law meant to protect employment rights of returning veterans.

The ruling will strengthen work protections for thousands of state-employed veterans returning to work after service in the Reserves or National Guard.

The outcome is a victory for Le Roy Torres, a veteran and former employee of the Texas Department of Public Safety. He told the agency that he could no longer serve as a state trooper and sought a comparable job to accommodate his service-related disability. When he was denied the job, he filed suit under federal law but lost in state courts. He appealed the decision to the US Supreme Court.

Justice Stephen Breyer wrote the majority opinion, joined by the other liberals as well as Chief Justice John Roberts and Justice Brett Kavanaugh.

Texas had argued that states are immune from such lawsuits brought under the federal Uniformed Services Employment and Reemployment Rights Act, passed under Congress’ war powers authority. The law was enacted to ensure that those who serve aren’t disadvantaged when they return to the work force with a service-related disability.

Breyer said that “upon entering the Union,” the states “implicitly agreed that their sovereignty would yield to federal policy to build and keep a national military.”

And emphasizing Congress’ war powers authority, he noted that “Congress has broad and sweeping power to raise and support armies.”

Justice Clarence Thomas wrote a dissent, joined by Justices Samuel Alito, Neil Gorsuch and Amy Coney Barrett.

Thomas said that “history and precedent” show that “when the States ratified the Constitution, they did not implicitly consent to private damages actions filed in their own courts – whether authorized by Congress’ war powers or any other Article I power.”

Steve Vladeck, a CNN Supreme Court analyst and professor at the University of Texas School of Law, said Wednesday’s decision “may come as a bit of a surprise to those familiar with the court’s prior cases concerning state sovereign immunity.”

“For 25 years, the justices have been wary of Congress’ power to authorize damages suits against nonconsenting states pursuant to any of its Article I powers,” Vladeck said. “In 2006, the court recognized a limited exception for bankruptcy law; today, the court adds a second for the war powers. It’s easy to understand why Congress’ war powers might be unique in allowing the federal government to override the states, but each exception calls the underlying principle into further doubt.”

The case came down to a clash between Congress’ authority to provide for national defense and a state’s ability to decide when it gets sued.

The ruling could affect thousands of active and reserve service members nationally who work for state agencies. Lower courts have split on the issue of whether Congress had the power to authorize such private lawsuits.

The federal government argued that a ruling that gives immunity to states in this area could damage the federal government’s ability to fill military ranks and defend the nation.

Torres enlisted in the US Army Reserve in 1989 and was deployed to Iraq in 2007. In Iraq, according to Torres, he suffered from serious lung damage after being exposed to toxic chemicals that were disposed of in so called burn pits.

Prior to his deployment, Torres had been employed as a state trooper by the Texas Department of Public Safety. After he was honorably discharged in 2008, he sought reemployment with the DPS in a different position because of his lung condition. The department declined to offer him a different job but did allow him to serve in “temporary duty” in his old job. Torres resigned.

Later, he sued DPS, arguing that its failure to offer him a job to accommodate his disability violated the federal Uniformed Services Employment and Reemployment Rights Act of 1994. The law – meant to protect veterans from employment discrimination – was passed under Congress’ power to “raise and support Armies.”

At oral arguments, Andrew T. Tutt, a lawyer for Torres, told the justices that the “Constitution gave Congress the power to raise and support Armies, and the reason for that grant was to ensure the survival of the nation.” He said the law’s protections are “crucial in light of the structure of the modern military” and noted that in order to convince soldiers to join the reserves force, Congress promised them “they would not be discriminated against on the basis of their military service or service-connected injuries.”

The Biden administration supported Torres in the case, arguing that the protections under the law “are especially important today to Guard and Reserve forces, who both serve the nation and work for employers” and that they incentivize participation.

Assistant Solicitor General Christopher G. Michel told the justices that while in most cases, state employers have immunity from private lawsuits, “this area is different” and that the law’s protections originated with the World War II draft and were expanded after Vietnam.

“The Constitution was adopted in large part to stop states from undermining federal efforts to raise a military,” Michel said. “Without a military, the federal government can’t defend itself.”

The United States has a military of 2 million people, 800,000 of them are National Guard members and reservists, according to the government.

Texas Solicitor General Judd E. Stone responded that the law’s authorization of private suits was unconstitutional because the states are protected by the legal doctrine of sovereign immunity. He told the justices that there was “no evidence” that the founding generation “saw the power to expose states to private lawsuits as inextricably intertwined with warfare or that states intended to be sued without their consent by giving Congress the power to raise an Army.”

This story has been updated with additional details.

CNN’s Chandelis Duster contributed to this report.