A federal appeals court struck down a U.S. immigration law that allows the government to deport someone for being a habitual drunkard, ruling Thursday the law illegally equates alcoholism with bad moral character.

“There is no rational basis to classify people afflicted by chronic alcoholism as innately lacking good moral character,” the three-panel court said in the majority opinion, citing the Equal Protection Clause in the Constitution.

Salomon Ledezma-Cosino is a Mexican citizen previously unable to appeal a deportation order, because he was found to be a habitual drunkard — at one point drinking a liter of tequila a day on average for 10 years. But if the court’s ruling stands, he’ll be able to petition the attorney general to remain in the country.

Congress passed a law more than 50 years ago that allows the attorney general to cancel the deportation of a non-citizen if that person is deemed to have good moral character under the law. Immoral character under the law includes habitual drunkenness, participation in genocide or torture, and convictions of serious felonies.

The U.S. 9th Circuit Court of Appeals ruling effectively strikes down the habitual drunkenness caveat, re-writing that part of the immigration law passed by Congress based on medical literature.

“The theory that alcoholics are blameworthy because they could simply try harder to recover is an old trope not supported by the medical literature,” Judge Stephen Reinhardt wrote for the majority. “Rather, the inability to stop drinking is a function of the underlying ailment.”

The dissenting judge argued someone can be a lifelong alcoholic and still control their drinking, so character does have a role, even if it’s a disease.

“If chronic alcoholics really had no ability to control their conduct, then such individuals would never be able to stop drinking,” Clifton wrote. “We know that is not the case, as Ledezma himself laudably demonstrated. Chronic alcoholics do not have to be habitual drunkards.”

Follow Rachel on Twitter

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.