Chavie Weisberger will never forget the day in October 2012 when her friend came over and told her that her ex-husband, Naftali Weisberger, was suing the formerly Hasidic mom for sole custody of their three young children. The following month, a judge ordered that the kids be immediately removed from her care.

“I was shocked. He was so absent,” Chavie, now 35, says of her ex. “I [had] tried to get him more engaged in the children’s lives with so much resistance.”

After divorcing her husband in 2009, Chavie had eventually come out as a lesbian, shocking her friends, family and ex-husband, who had since remarried and started a new family.

‘To him, you can’t raise Hasidic kids with a queer mother.’

“To him, you can’t raise Hasidic kids with a queer mother,” Chavie tells The Post. Naftali, who declined to be interviewed for this article, argued that she had violated the religious-upbringing clause in their divorce agreement, which required that she bring up their children in a strict Orthodox environment. According to court papers, he maintained that she had “radically changed her lifestyle” — including coming out to her eldest daughter and living with a transgender man.

The courts agreed with him. In 2015, Brooklyn Judge Eric Prus awarded Naftali sole legal and residential custody of their two daughters and one son — and even forbade her from discussing her sexuality with her youngest children.

“I felt terror,” she says of the 2015 ruling. “The whole world came crashing down on me.”

Life wasn’t always so turbulent for Chavie, who had a typical upbringing — at least for someone raised in the ultra-Orthodox enclave upstate in Monsey, where she grew up. One of 10 siblings, she was forbidden from interacting with boys or anyone less observant than her. “When I was 12, my father gave me a prayer to start saying every day to get a good shidduch [arranged marriage],” she says.

In March of 2002, at age 19, Chavie married Naftali. The nuptials took place just six months after Chavie first met him at her’s sister’s home. (They got together a second time not long after, and then her parents informed her that they were engaged.)

After the wedding, the pair moved to Borough Park, and she soon became pregnant. But with no college education, she says she “felt trapped.” She started seeing a Hasidic therapist within the first year of marriage, to whom she admitted being in love with women.

“He said, ‘You’re a lesbian,’ and I said, ‘What’s that?’ I was attracted to girls always, and I thought it was wrong, but I also didn’t quite understand what it was,” she says.

But Naftali wanted to maintain the status quo, so she stayed in the marriage and gave birth to her first daughter at age 20. “I wanted to be a good mother and make enough money to support our family,” she says. In keeping with certain ultra-Orthodox traditions, Naftali studied the Torah while Chavie was the breadwinner, working as a teacher, running an after-school program and tutoring on the side.

Problems in the marriage continued, and Chavie asked for permission to go on birth control. “I almost felt guilty bringing more children into a marriage that wasn’t sustainable,” she says. But her rabbi, who makes the call on such family matters, initially denied her request.

The pair finally divorced in 2009.

“[I] couldn’t live a lie, married to a person I didn’t love,” says Chavie, who readily agreed to raise their children, ages 2, 3 and 5 at the time, Hasidic, according to the Jewish divorce papers or “get.”

“I was still super religious,” says the young woman, who had no legal representation throughout the process. “I just signed it.”

She continued to shave her head, wear a sheitel [wig] and drape herself in long skirts as she walked the streets of Borough Park. She also dutifully went on dates with men her mother arranged, but they never felt right.

Over the next three years, she slowly found a community outside the austere ultra-Orthodox one from which she was raised never to stray. That community included Jewish LGBT members, whom she introduced to her children. “I thought there was room for me to be a good parent and still be true to myself and my sexuality,” she says.

“We had conversations — [that] different people have different sexualities,” says Chavie. “I didn’t want to hide parts of myself to people who were closest to me: my children. I wanted a legitimate, honest, whole life with my children.”

‘I thought there was room for me to be a good parent and still be true to myself and my sexuality.’

Her family wasn’t supportive. While they knew she was attracted to women during her marriage, they remained hopeful she would work through it and “cure the flaws,” she says. When it became clear she wasn’t going to do that, she says they started siding with Naftali.

“‘We want the children to be religious, so we’re going to support your ex-husband,’” she recalls them saying. “It was so painful … It was an awful time.”

Then, in November 2012, a judge ordered the kids to be removed from her home. “It was awful and traumatic, and I had to keep a brave face and act like it wasn’t a big deal,” says Chavie, who eventually got lawyers pro bono through the nonprofit organization Unchained at Last, which helps women escape arranged and forced marriages.

After three years of legal battles, she received the judge’s decision via e-mail from her lawyer. She was allowed limited, supervised visitation and she had to stick to the script: no acknowledgment of her homosexuality to the youngest kids.

The new arrangement took a toll on the children, at this point pre-teens, and every moment felt like a test. “It was a delicate dance — we could only discuss certain topics,” she says. “It was hellish. I was living on tiptoes, in constant fear.”

Shortly after the 2015 court decision, Chavie was hired as a community engagement coordinator at Footsteps, the organization that helps the ultra-Orthodox adapt to the broader world.

She fought the decision, and this summer, an appeals court reversed the ruling, granting the doting mom full custody of her kids, now ages 10, 12 and 14 — provided she keeps a kosher home and continues to keep the children in Hasidic schools. Naftali is granted weekend and holiday visitation.

“A religious-upbringing clause should not, and cannot, be enforced to the extent that it violates a parent’s legitimate due-process right to express oneself freely,” wrote the panel of three judges.

The best part? “Now when the children are with me, I don’t have to pretend to be someone I’m not,” she says. “That’s the biggest thing. I can share my full self and raise my children as who I am.”

These days, she’s settled on a secular lifestyle, but she insists she has no intention of exposing her kids to anything that flies in the face of the court ruling. “I’m Jewish, and I love the culture and history and food and I feel very connected to the tradition — I just don’t believe in God,” she says.

Rather, she says she’s raising them to be open-minded.

“My kids have so much more information [than I had at that age] — they are empowered,” she says. “I just want them to go to college and not get married at 18.”