A TELL-ALL revealing Michael Jackson’s secret gay life may be shelved, sparing his family more heartbreak, The National ENQUIRER has learned.

According to legal documents obtained by The ENQUIRER, Jackson’s ex-lover, Jason Pfeiffer, who claimed he had a “romantic” affair with Michael, “that ended in tragedy,”has surrendered all rights to publish the seamy story.

“We had a relationship with sexual aspects, but I’m not going to make it into some grand love affair,” Pfeiffer had said in 2009.The ENQUIRER has learned that Jason’s plan to pen a tell-all has been trashed in a legal deal engineered by Michael’s former dermatologist, Dr. Arnold Klein. Pfeiffer, who worked for Michael’s dermatologist Dr. Arnold Klein, claimed his romance with Jackson began over the phone, which was followed by several discreet meetings.

In 2011, Dr. Klein sued Jason, who previously worked for him, and another former employee, claiming they’d stolen an estimated $10 million in cash and other assets from him.

Now, Jason has agreed to a series of bizarre terms to settle the case.

A Jackson family source told The ENQUIRER: “This is a major win for the family. It’s especially important for Michael’s kids who would have been humiliated to read about their dad in the way Jason has described.”