Andrea Davidovich, a pairs figure skater for Israel at last year’s Sochi Winter Olympics, had to sue the Jewish state’s national squad to get out of her contract and away from what she called a “dictatorial” and “hostile” team president who spread false sexual rumors about her — even when she was a minor.

In a decision made public Wednesday, New Jersey Judge Robert Wilson released the 18-year-old rising star — a dual Israeli-US citizen who was born in Vermont — from the contract, which she had compared to indentured servitude.

“She is really ecstatic,” said her lawyer, Stuart Slotnick, who said Davidovich wants to skate for Team USA at the 2018 Games in South Korea.

The teen told The Post, “I am so grateful for the support of my family and attorneys, and, most importantly, the judge’s decision.”

Davidovich, who lives in Livingston, NJ, sued the Israel Ice Skating Federation and its president, Boris Chait, in September, saying he made her life miserable and refused to let her off the team.