Free beer: Great. Beer that ferments inside your stomach without you knowing why you're getting drunk: Not so great.

In a case study published in the peer-reviewed British Medical Journal Open Gastroenterology, doctors describe a patient who repeatedly had elevated blood alcohol levels but denied ever drinking a drop.

The cause: a rare condition known as "auto-brewery syndrome," or ABS, which causes the carbohydrates one ingests to turn into alcohol, fermented by fungi or bacteria in the gastrointestinal system.

"ABS is probably an underdiagnosed condition," the study authors wrote, adding that no diagnostic criteria exists to confirm the syndrome or treat it. However, the researchers do propose treatment that could be tested in future studies.

Here's what to know about the unusual condition.

Case study: How a man got drunk without taking a drink

The unnamed 46-year-old man in the BMJ case study, published in August, was otherwise healthy and had no other major medical condition before January 2011, when he began experiencing memory loss, mental changes and episodes of depression.

The changes occurred after he began taking antibiotics for a traumatic thumb injury, and after he completed the 3-week antibiotic course, he reported an uncharacteristic depression, "brain fog" and aggression.

Years later, he was arrested one morning on suspicion of driving while intoxicated. The man was hospitalized, and had a blood alcohol level of 0.2 g/dL, well above the legal limit of 0.08. Despite police and hospital staff not believing him, the man maintained he never had a drink that day, the case study says.

"He was unable to function and (symptoms appeared) mainly after meals," Dr. Fahad Malik, study author, told TODAY.com. "No one believed him."

The man had heard of similar cases and went to a doctor in Ohio, who confirmed that in his stool were two similar yeasts, Saccharomyces cerevisiae, or "brewer’s yeast," and S. boulardii.

Doctors diagnosed him with ABS by giving him a carbohydrate meal then measuring his blood alcohol levels, which reached .05 g/dL within eight hours.

He was prescribed an anti-fungal treatment for a few weeks and was told to steer clear of carbs in his diet. But soon, the symptoms returned, and more doctors were stumped.

The problem got so bad that he fell and suffered a brain bleed that required he be admitted to the hospital. There, his blood alcohol levels ranged from .05 to .4 g/dL, and again, medical staff didn't believe he wasn't drinking.

The man then sought out the doctors who wrote the case study. The doctors found other yeasts in his system, including Candida albicans and C. parapsilosis, and prescribed further anti-fungal treatment, but the man had a meal of pizza with soda that caused a severe relapse.

The doctors then gave him an IV micafungin treatment for six weeks that eventually cleared out all the fungus. He then began taking a probiotic to stifle fungal growth. Soon, doctors were able to slowly introduce carbs back into his diet, and a year-and-a-half later while continually taking the probiotic, symptoms have not returned.

What causes auto-brewery syndrome?

The study authors believe the initial antibiotic treatment sparked the patient's ABS. When the man took the medication after his thumb injury, it changed his "gastrointestinal microbiome allowing fungal overgrowth," the say.

According to NPR, other cases of antibiotics clearing out gut bacteria and allowing for yeast to grow have been documented.

Other cases had been documented in people who had weakened immune systems or complications from surgery or Crohn’s disease, the study says.

Yeasts from the Candida and Saccharomyces families are able to produce endogenous ethanol within a patients' gut, according to the National Center for Biotechnology Information.

But how do people function with such high levels of alcohol?

That's part of what makes ABS so hard to understand. While the cases have shown patients suffering from the intoxication, other instances show them functioning normally.

"I'm in touch with about 30 people who believe they have this same syndrome, about 10 of them are diagnosed with it," Panola College Dean of Nursing Barbara Cordell told CNN in 2016.

"They can function at alcohol levels such as 0.30 and 0.40 when the average person would be comatose or dying. Part of the mystery of this syndrome is how they can have these extremely high levels and still be walking around and talking."

How to treat auto-brewery syndrome

The doctors note that no standard exists for diagnosing and treating the condition, but they propose a combination of "dietary modifications, appropriate antifungal therapy and possibly probiotics" should be studied further as a treatment.

The National Center for Biotechnology Information also notes antibiotics should be avoided as well as carbohydrates.

Other cases of auto-brewery syndrome

Cases in Japan were first documented in the 1970s, and U.S. cases came 10 years later, according to the researchers.

A 2014 case involved a man who crashed in Oregon, causing 11,000 salmon fell from his truck, the Washington Post reported. He was charged with DUI, but said he had auto-brewery syndrome.

A woman in New York had a DUI charge dismissed in 2015 after her lawyers argued she had ABS, too, CNN reported.

However, the case reports do not necessarily mean what causes ABS and how to treat it is a settled matter.

"The problem with a case report," Dr. Joseph Heitman, a microbiologist at Duke University, told NPR in 2013, "is that it's just one person. It's not a controlled clinical study."

Follow USA TODAY's Ryan Miller on Twitter: @RyanW_Miller