The beautiful wife of a millionaire Long Island real-estate mogul got a judge to rip up her prenup — a rare, precedent-setting decision that could influence countless marriages to wealthy people.

Elizabeth Petrakis, 39 — sometimes acting as her own lawyer — got a an appellate panel last month to toss the agreement she signed with Peter Petrakis, 41, four days before their lavish 1998 wedding.

The prenup stipulated that Peter, who parlayed a string of smoke shops into a $20 million commercial real-estate empire, would keep everything in his name if they split up.

But Elizabeth argued for seven years that Peter coerced her signature, threatening to call off the wedding even though her father had already paid $40,000 for the reception.

“He told me he would rip it up as soon as we had kids,” Elizabeth, who has since had twin sons and a daughter, told The Post at her Old Brookville mansion.

“But he never did. The reason this happened was I was an advocate for myself and I didn’t give up.’’

She called the document “a knife in my heart from Day One.’’

On February 20, a Brooklyn Appellate Court panel unanimously affirmed two Nassau County court decisions, saying Peter “fraudulently induced” Elizabeth to sign the prenup and found Peter’s “credibility to be suspect.”

The duo will now begin divorce proceedings.

The decision “is unprecedented, vacating a pre-nup on the basis of a verbal promise,” even though a clause in the contract says there were no verbal promises, said Elizabeth’s lawyer, Dennis D’Antonio.

“It resets the bar. It’s an entirely different landscape out there in regard to prenups. I’ve been inundated with calls. Spouses who are challenging pre-nups now have a leg to stand on,” D’Antonio said.

Now, Elizabeth says, her husband suddenly wants to end their divorce battle.

He declined to comment.

“His need to be successful was more important to him than the need for me to be his wife or the mother of his children,” she said.

Elizabeth is now beginning a business called Divorce Prep Experts, which counsels people divorcing with prenups.

Longtime divorce lawyer Raoul Felder, who has never overturned a prenup in his three-decade career and has no involvement in the Petrakis case, called the decision “really rare” and precedent setting.