For years, no one believed an apparently drunk man who said he didn’t drink any alcohol.

He’d become prone to falls, displayed “brain fog and aggressive behavior” and was even arrested for suspicion of driving while intoxicated, all while swearing he hadn't touched a drop of booze.

His family, his doctors and police were convinced he was a closet drinker.

The truth was much stranger: the 46-year-old man’s body had begun producing its own alcohol in his gut whenever he ate carbohydrates — a rare condition known as auto-brewery syndrome.

It happens when “gut disturbances,” including antibiotic use, allow certain fermenting fungi or bacteria in the gastrointestinal tract to grow unchecked. When a person then consumes carbs — like pizza, pasta, bread and soda — the legions of fermenting microbes dutifully turn the sugar in that food or drink into ethanol, leading to “extreme blood alcohol levels,” research found.

The strange phenomenon was even featured in an episode of "Gray's Anatomy." It may sound amusing, but experts say the appearance of unexplained and random intoxication can have a profound effect on patients' lives and can lead to family, workplace and legal troubles.

Auto-brewery syndrome should be considered as a possibility in any patient who shows alcohol toxicity, but denies drinking alcohol, doctors at Richmond University Medical Center in New York wrote as they described the unnamed man’s case in BMJ Open Gastroenterology.

The man's troubles started in 2011 after he began taking antibiotics for a thumb injury, they said. He’d always been healthy and active, but began to experience “very uncharacteristic” personality changes, along with episodes of depression.

"He was unable to function and it was mainly after meals," Dr. Fahad Malik, co-author of the case report, told TODAY. "No one believed him."

A psychiatrist treated him with anti-depressants and anti-anxiety medication. Then, police arrested him for DUI when his blood alcohol concentration measured 0.2 percent, or more than twice the legal limit and enough for most people to experience a blackout.

“The hospital personnel and police refused to believe him when he repeatedly denied alcohol ingestion,” the case report noted.

Things began to turn around when the man’s aunt heard about a similar case treated in Ohio. She bought a breathalyzer to keep track of his alcohol levels and urged him to get lab testing, which detected brewer’s yeast in his stool.

To confirm he had auto-brewery syndrome, the doctors in Ohio asked him to eat a carb-heavy meal, then monitored his blood alcohol levels, which indeed spiked after eight hours.

He felt better after a brief round of antifungal medication and a strict carb-free diet, but soon relapsed, leading to a serious fall. His blood alcohol levels were swinging wildly.

The man then sought help from doctors at Richmond University Medical Center, who gave him antifungal therapy that was successful for several weeks, with one setback.

“Unbeknownst to us, he ate pizza and drank soda while on this treatment, resulting in a severe ABS relapse,” the case report noted.

Finally, tests of his gastrointestinal secretions showed the fungal growth was gone. He began taking probiotics — microorganisms that promote the good bacteria in a person's digestive system — which helped to bring his gut flora back to normal, and his symptoms vanished. More than a year after this treatment, he has resumed eating a normal diet, the case report noted.

His doctors believe the antibiotics prescribed for his thumb injury triggered the condition by changing his gut microbiome and allowing “fungal overgrowth.”

As strange as it sounds, they believe auto-brewery syndrome is probably an under-diagnosed condition.

Follow NBC HEALTH on Twitter & Facebook.