For six long years, a man would experience mysterious bouts of drunkenness without ever drinking a drop of alcohol.

Eventually, he was diagnosed with a rare condition that filled his gut with booze.

The 46-year-old man had auto-brewery syndrome (ABS), a condition that causes bacteria in the gut to transform carbohydrates into intoxicating alcohol, according to a report of the man's case, published Aug. 5 in the journal BMJ Open Gastroenterology . The condition flares up when people consume sugary or carb-heavy foods and beverages, and throws them into a drunken haze just as if they'd knocked back too many beers, the man's doctors wrote.

The man was "unable to function, and it was mainly after meals," Dr. Fahad Malik, co-author of the report, told the Today show . The man's symptoms emerged after he received antibiotics in 2011 following a "complicated traumatic thumb injury," the report said. The medication likely disrupted his gut microbiome, or the community of microorganisms, such as bacteria and fungi, living there. "No one believed him" when the man said he didn't drink, Malik said.

Related: 7 Ways Alcohol Affects Your Health

The patient experienced a " brain fog," displayed uncharacteristically aggressive behavior and was even arrested for drunk driving. On that occasion, the man's blood alcohol concentration registered at twice the legal limit, but he insisted he hadn't been drinking. The hospital personnel and police didn't buy it, the report noted.

Following his arrest, the man's aunt came across a case report describing a patient in Ohio who was treated for a similar condition. She and the man traveled to the Ohio clinic, where doctors searched the man's poop for boozy microbes . They uncovered strains of Saccharomyces boulardii and Saccharomyces cerevisiae, otherwise known as brewer's yeast, in the stool samples. At this point, they suspected the man had auto-brewery syndrome but asked him to chow down on some carbs, to make sure.

Eight hours later, the man's blood-alcohol concentration spiked to more than 0.05% (close to the legal blood alcohol limit for driving), confirming his unusual diagnosis.

Despite receiving anti-fungal treatment and being placed on a no-carb diet , the man still experienced flare-ups. He saw internists, psychiatrists, neurologists and gastroenterologists in attempts to get his spontaneous drunkenness under control. During this time, one extreme episode left the man with a dangerous head injury and a potentially fatal blood alcohol concentration of 0.4%. "Here too, the medical staff refused to believe that he did not drink alcohol despite his persistent denials," the report said.

Then, the man sought help at Richmond University Medical Center in Staten Island, New York, where doctors placed him on antibiotics and monitored him closely for about two months. The therapy successfully rid the patient's gut of the boozy microbes, though, at one point, the man "ate pizza and drank soda while on this treatment, resulting in a severe [auto-brewery syndrome] relapse," the report said. The patient was then prescribed probiotics to promote the growth of helpful gut bacteria. Slowly, the man was able to incorporate carbs back into his diet.

A year and a half later, the man can enjoy a slice of pizza without fear of intoxication — or potential alcohol-induced liver damage .