Blue Bloods alum Jennifer Esposito has opened up about her difficult health journey and the severe depression and panic attacks that led to an “excruciating” stay in a psych ward.

Appearing on a recent episode of the Heal Squad podcast, the 53-year-old — best known for playing Detective Jackie Curatola on the hit CBS show — detailed the myriad of physical and mental health symptoms she experienced as a result of undiagnosed celiac disease.

Celiac disease is an autoimmune condition in which the consumption of gluten, found in rye, wheat and barley, causes the immune system to overreact and mistakenly attack the small intestine.

Esposito recalled that it was during her two-season stint on the sitcom Samantha Who? when “things started to collapse.”

“I had hair falling out, nails falling off,” she said. “A tooth fell out of my mouth, like literally in the middle of a scene. I was so depressed [about] being so sick all the time, and fighting panic disorder.”

Eventually, she went to a female doctor who listened to her entire health history and took blood tests before discovering Esposito had one of the worst cases of celiac disease she had ever seen.

“She’s like, ‘I’m not sure how you’re alive; My liver was failing,” the actor recounted. She explained that her body was taking nutrients from her nervous system, which is why “my panic disorder was out of control.”

“When I stopped the gluten and went through this detox, they had me on four Klonopin a day” as a way to treat her panic attacks, she said.

“I was literally sleeping in my kitchen,” Esposito added, “because it was the only place that didn’t have a window because the stimulus from the light would make me tremble and shake.”

Months after her diagnosis, she connected with a medical expert who wanted to study her “because I was so ill.”

Esposito remembered on one particular visit, pleading with the doctor to keep her there “because I’m jumping out of my skin. I’m going to jump out the window.”

The doctor interpreted her remark as suicidal, “and within half an hour, I was wheeled upstairs to the psych ward,” she said. “I will say it was seven of the most excruciating hours of my entire life because I was yet again pleading for my sanity.

“You can’t put someone who’s having severe panic disorder in a locked space,” she noted, adding that the doctors continued to misunderstand her symptoms.

“And it was because I said I was going to jump out the window, they thought I was going to harm myself,” Esposito continued.

“I remember [the doctor] looked at my dad and he was like, ‘Is she always this hostile?’” she said. “And I just thought, if I ever get out of here … I have to do something.”

Her experience inspired her to share her difficult health journey in her 2014 memoir, Jennifer’s Way, and to connect with other celiacs through community groups.

If you are experiencing feelings of distress, or are struggling to cope, you can speak to the Samaritans, in confidence, on 116 123 (UK and ROI) or visit the Samaritans website to find details of your nearest branch.

If you are based in the USA, and you or someone you know needs mental health assistance right now, call or text 988, or visit 988lifeline.org* to access online chat from the 988 Suicide and Crisis Lifeline. This is a free, confidential crisis hotline that is available to everyone 24 hours a day, seven days a week. *

If you are in another country, you can go to www.befrienders.org to find a helpline near you.