New York Islanders goalie Robin Lehner opened up about a suicidal state he found himself in this past spring as a result of an untreated bipolar disorder and a crippling battle with addiction.

"I wanted to kill myself. I was extremely close multiple times," Lehner wrote in an essay as a guest author for The Athletic published on Thursday. "The battle of playing hockey was nothing compared to the battle inside my brain. It was at its worst."

The 27-year-old Lehner described managing his depression and anxiety by drinking a case of beer a day to "settle the demons" and taking pills to help him fall asleep.

"I was self-treating myself because I could not be inside my own head by myself," he wrote. "The thoughts of ending it all ... it was real and close."

More:Humboldt Broncos junior hockey team makes emotional return from bus crash

More:Predators forward Austin Watson suspended 27 games in domestic-violence case

The Sweden native said he hit a turning point on March 29 when he finally asked for help following a panic attack when he was the Buffalo Sabres' goalie. He turned to the NHL and NHL Players' Association, and was directed to a detox program in Arizona that saved his life.

"It finally didn’t matter. I was going to rehab for myself and my family," he wrote. "It was the one thing I have done in my life that made me feel like a true man."

At The Meadows, an addiction treatment center, Lehner was diagnosed with "bipolar 1 with manic phases" as well as ADHD with post-traumatic stress disorder. He said his battle was complicated by a childhood that was surrounded by abuse, addiction and mental illness.

Lehner stayed for additional time after his original stint at The Meadows. "I was told my detox was one of the worst that they had seen," Lehner said.

After he got clean and addressed his mental illness, Lehner said he was able to "finally love" and "feel love" as a husband and father. But that hardest part, he said, "was getting back to hockey."

Lehner came to realize how his bipolar disorder affected his play. "I had never had a sober season of hockey my entire career," he said. "With those manic swings, I could see the pattern. When I was hypomanic and in a good mood, I was a solid goalie. The depressive state, not so much."

Lehner said before the Islanders signed him to a one-year deal in July, he faced an uphill battle with NHL teams as a free agent because he wasn't fully ready to go public with his mental illness. He said not finding a team almost drove him back to alcohol.

"One meeting in particular was worse than any other," he wrote. "I was bombarded with questions about why I was a bad person or a bad teammate and I couldn’t say anything. I just took it for hours. I was told that I was a bad influence and I had less than one chance or I would be buried in the minors and that would end my career. I was crushed."

Lehner said his main reason for going public now is based on helping others and de-stigmatizing mental illness.

"It is time to take the 'crazy person' stamp from bipolar disorder," he wrote. "I want people to know that there is hope in desperation, there is healing in facing an ugly past and there is no shame in involving others in your battle."