Updated with comments from Walmart and the Texas Package Stores Association.

Walmart won't be opening liquor stores in Texas anytime soon.

The 5th U.S. Circuit Court of Appeals this week reversed an earlier federal court ruling in favor of Walmart, which challenged the constitutionality of a law that prevented it from selling liquor in Texas.

"On behalf of our customers, we are disappointed by the court's ruling which hurts Texas consumers," said Walmart spokeswoman Anne Hatfield. "We are considering all of our options."

Walmart sued the Texas Alcoholic Beverage Commission in 2015. In early 2018, U.S. District Judge Robert Pitman agreed with Walmart that the state law was unconstitutional. The law prohibits publicly owned corporations from obtaining liquor store permits in Texas.

The Texas Package Stores Association, representing more than 3,000 liquor store owners in the state, appealed Walmart's win to the federal appeals court. That court ruled Thursday that the U.S. District Court in Austin erred in its findings.

The appeals court held the state law didn't discriminate against Walmart because it treats in-state and out-of-state companies the same.

It sent the case back to the lower court, saying the Austin court committed an "error of law" in how it analyzed Walmart's assertion that the Texas Legislature in 1995 acted with the intent to discriminate against out-of-state companies.

Lance Lively, executive director of the Package Stores Association, said the court's decision "protects Texas consumers, small business owners and Texas' right to regulate the sale of liquor in Texas."

He said the industry group will continue "to fight for the preservation of thoughtful regulation to keep Texans safe, keep sensible restrictions on the retail sale of liquor, and support family-owned liquor store owners against the world's largest corporate entities that seek to inflate their profits by upending sensible state laws that protect consumers."

Twitter: @MariaHalkias