The Supreme Court unanimously ruled Tuesday that ranchers can sue the state of Texas over highway construction they allege flooded their lands.

"This is the pinnacle of a long, hard-fought battle, and we can’t stress enough what a blessing this is," rancher Richie DeVillier said in a statement after the ruling.

But in an unusual twist, Texas Attorney General Ken Paxton is also claiming victory, stating the court's decision protects "the ability of Texas to handle compensation disputes under State law for any allegedly taken property."

Richie DeVillier and his wife stand in front of Supreme Court

The Supreme Court unanimously ruled that Richie DeVillier and other property owners can sue the state of Texas under the Fifth Amendment. (Courtesy Institute for Justice)

SUPREME COURT HEARS CASE OF TEXAS GRANDMOTHER THROWN IN JAIL AFTER CRITICIZING CITY GOVERNMENT

DeVillier's family has lived in Winnie, Texas, since the early 1900s when his great-grandfather homesteaded the land. In all that time, their 900 acres had never flooded because water naturally flowed south to the Gulf of Mexico, DeVillier said.

Then the Texas Department of Transportation renovated Interstate 10 along the ranch, widening the highway, raising it a foot and a half and adding an impermeable, nearly three-foot-high concrete barrier along the middle of it, according to DeVillier and his lawyers from the Institute for Justice.

The ranch turned into a lake when Hurricane Harvey hit. In addition to extensive damage to their home and belongings, the DeVilliers lost about 60 of their 300 cows and calves, plus seven horses.

"That was one of the most horrible things that I've had to go through," DeVillier previously told Fox News. "It's hard enough seeing a cow drowned. But horses are a different thing. Horses are parts of our souls."

Two years later, Tropical Storm Imelda hit and their ranch flooded again.

Photos of cows, haybales, equipment submerged in flood

Left, Richie DeVillier's son leans over the side of a boat to hold a calf's head above water. Center, hay bales and ranch equipment stick out of the floodwaters following Hurricane Harvey in 2017. Right, water covers one side of Interstate 10. (Courtesy Institute for Justice)

CANCER SURVIVOR DEALT NEW BLOW AFTER TEXAS POLICE DESTROYED HER HOUSE, BUT LAWYERS SAY CITY STILL HAS TO PAY

The DeVilliers and their neighbors sued, arguing that Texas can turn their farms into a lake if it needs to, but not without paying the property owners. They pointed to the Fifth Amendment of the Constitution, which protects Americans against the taking of property by the government without compensation.

Texas argued that the Takings Clause in the Fifth Amendment didn't apply since it doesn't explicitly indicate that a state government must provide just compensation for property it seizes or damages. The 5th Circuit Court of Appeals agreed.

But Texas changed course in January when attorneys presented their cases before the Supreme Court, telling the justices that the ranchers could in fact sue in state court under the Fifth Amendment.

"You're the one who removed to federal court," Justice Sonia Sotomayor said at the time. "This seems to me like a totally made-up case because they did exactly what they had to do under Texas law."

Texas Solicitor General Aaron Nielson rejected that characterization, saying the state may simply have "misunderstood" what the ranchers were arguing, according to SCOTUS transcripts. Nielson said Texas would not oppose an attempt by DeVillier to amend the lawsuit and proceed under state law, according to the court’s opinion, written by Justice Clarence Thomas.

WATCH: RANCHER SAYS TEXAS HIGHWAY PROJECT FLOODED HIS LAND, KILLING CATTLE AND HORSES:

WATCH MORE FOX NEWS DIGITAL ORIGINALS HERE 

The Supreme Court unanimously vacated the 5th Circuit decision and ruled that the DeVilliers and other property owners should be allowed to "pursue their claims under the Takings Clause through the cause of action available under Texas law."

"Texas’s rapid about-face at the Supreme Court means that Richie and his family will still have their day in court," IJ President and Chief Council Scott Bullock said in a prepared statement.

But Paxton's office declared itself the winner in the case in a press release Tuesday afternoon.

"For as long as Texas has been Texas, it has recognized that property rights are crucial to a free society," Paxton said. "Under the U.S. Constitution, such claims should be pursued under state law unless Congress has said otherwise. I’m pleased the Supreme Court agreed with us unanimously that citizens should sue under Texas law."

IJ Deputy Litigation Director Robert McNamara, who argued on DeVillier's behalf, was baffled by Texas' characterization of the outcome.

"The upshot of today's decision is that Richie's case against Texas is going to trial when Texas didn't want it to," McNamara said. "That's what losing looks like."

CLICK HERE TO GET THE FOX NEWS APP

The Texas attorney general's office did not respond to emailed questions about the case. The state doesn’t admit or deny in court documents that raising the interstate caused the flooding.

To hear more from DeVillier and to see video of the floods, click here.