New York Islanders goaltender Robin Lehner had a rough 2017-18 season, and his final game with the Buffalo Sabres was his worst on-ice experience.

Mar 8, 2016; Buffalo, NY, USA; Buffalo Sabres goalie Robin Lehner (40) looks back into the net as a goal is scored by New York Rangers center Derick Brassard (16) (not shown) during the first period at First Niagara Center. Mandatory Credit: Kevin Hoffman-USA TODAY Sports / Reuters

It also was a development that proved to be a key to a solution.

Lehner had a panic attack after the second period of a March 29 game against the Detroit Red Wings, soon entered treatment for addictions to alcohol and drugs, and later was diagnosed with bipolar disorder as well as attention deficit hyperactivity disorder and post-traumatic stress disorder.

The 27-year-old Lehner revealed his battles in a first-person account for The Athletic.

He described heavy pain in his chest and everything on the ice becoming blurry during the second period of the game against Detroit. He reached a point where he just wanted -- and needed -- the period to end.

“When zero finally hit, I walked back and sat in the trainer’s room,” Lehner wrote. “I could barely get my gear off. I broke down. I was having a major, full-blown panic attack. I thought I was suffering a heart attack. I had no idea what was happening. I could not go back on the ice.”

The Sabres sent Lehner home and things continued to spiral downward. Lehner’s drinking was out of control and he eventually agreed to get help.

He said it took three weeks for him to detox once he arrived at the treatment facility in Arizona. And the more sober he got, the more the demons arose. Doctors studied deeper and diagnosed him with the mental illnesses.

Lehner could see that the ups and downs of bipolar disorder correlated with his play as a goalie.

“I had never had a sober season of hockey my entire career,” Lehner wrote. “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.”

On the personal side, those frequent thoughts of suicide have subsided and he is looking forward to getting back on the ice. The Sabres released him in June and the Islanders signed him to a one-year deal in July.

“The Islanders were ready to take a chance with me,” Lehner said. “I was relieved that I could start a new chapter. When I was finally offered the deal, I was so happy. I finally had someone who believed in me, now sober.”

Lehner went 14-26-9 with a 3.01 goals-against average in 53 games (50 starts) for Buffalo last season.

Overall, he is 72-97-35 with a 2.82 GAA and .915 save percentage in parts of eight seasons with the Ottawa Senators (2010-15) and Sabres (2015-18).

--Field Level Media