A former NHL All-Star who played for ​both the Rangers and Islanders is entangled in a legal faceoff with an insurance company over an $18 million payout.

Standard Security Life went on the offensive against ​retired ​defenseman Bryan Berard on Thursday​,​ filing a Manhattan lawsuit after ​the stick handler accused the company of fraud, according to court papers.

Standard sued to preempt threatened litigation by Berard, the suit says.

Berard got a $6 million insurance settlement from Standard in 2001 after suffering a seemingly debilitating and career-ending eye injury in March 2000.

In 2000, while Berard was playing for the Toronto Maple Leafs, the stick of Ottawa Senator Marian Hossa clipped him in the right eye. He suffered a retinal tear and a detached retina.

During the next season, Berard underwent seven eye operations and started working out and skating again. He was fitted with a contact lens that allowed him to meet the league’s minimum vision requirement and went on to play another seven seasons, starting his comeback with the Rangers.

He ended up returning the insurance payment per an agreement, the civil suit says.

After ​testing positive for steroids in 2006, Berard made another comeback ​the next season ​with the Islanders, and in his first game back, scored the winning goal against the Rangers.

Berard retired in 2009. But then in 2013, he hired an attorney and came after Standard, saying he never should have had to repay the insurer.

He is demanding $18 million in benefits, interest and penalties, claiming the agreement to relieve Standard of future claims was a fraud.

Berard, 37, told The Post, “I’m disabled. I have no vision in my right eye.”

The Manhattan resident said he had not been served with legal papers and declined to answer questions about the suit.

Standard is asking the court to enforce the disputed document.

The insurer’s lawyer declined to comment.