A Los Angeles judge has overturned the divorce settlement Terrence Howard reached with his second wife after finding the actor signed the 2012 agreement under duress.

Howard’s ex was no Cookie Lyon, but Los Angeles Superior Court Judge Thomas Trent Lewis said she was manipulative enough to scare him into thinking she would leak private details about him, including phone sex recordings with other women and a video of the actor dancing naked in a bathroom.

“The evidence of extortion or duress was unrebutted,” Lewis said in his ruling.

The ruling means Howard and his ex-wife Michelle Ghent, will have to negotiate a new financial agreement.

The “Empire” star tearfully testified about Ghent’s threats during a recent hearing.

Lewis did not hear from Ghent because her attorneys did not submit a sworn statement from her in advance of the hearing.

The agreement entitled Ghent to a share of Howard’s earnings, which would have included a portion of his salary from the hit Fox series “Empire,” which opens its second season in the fall.

Ghent’s lawyers have said she denied extorting the actor in a deposition and argued he didn’t prove threats she made in 2011 forced him to sign the agreement a year later.

At least one family-law attorney was surprised by the judge’s ruling.

“If the fear of embarrassment is enough to claim you don’t have to honor a contract, then the integrity of contracts has officially been lowered to less than a handshake,” said Michael Stutman, head of family law at Mischon de Reya New York.

“Claiming you don’t have to honor a signed divorce agreement because you were fearing embarrassment is a cop-out excuse to not fulfill your obligations, and I’m shocked the courts have ruled in his favor.”

Lewis presided over a four-day hearing that revealed numerous private details about the Oscar-nominated actor, including that he had cheated on Ghent during their engagement, he was physically violent with his first wife, and he has already divorced his third wife.

Howard, 46, has denied any physical abuse.

Lewis also heard a 2011 call in which Ghent berated Howard and threatened to sell private information about him if he didn’t pay her money by the end of the day. Howard’s accountant sent Ghent $40,000 in response to the call, which he called “hush money.”

The actor was nominated for an Academy Award for his starring role in 2005’s Hustle & Flow.

His career has surged since the debut of “Empire,” in which he plays Lucious Lyon, the head of a family hip-hop empire.