Legal docs reveal TORI SPELLING badboy hubby DYLAN McDERMOTT shockingly gave up parental rights to his daughter to marry the “reality” star.

When he divorced his ex-wife, Mary Jo Eustache in 2006, McDermott agreed to give up parental rights to his newly adopted daughter, Lola, to be with Spelling, RadarOnline reported.

In never-before-seen court documents McDermott says as part of a sworn declaration  made as part of his divorce proceedings with Eustace, he admitted that that “the birth and pending adoption of Lola in July 2004 was incredible, not only because she is a beautiful healthy girl, but I believed this was something that would finally make [Mary Jo] happy after several miscarriages, fertility drugs and a failed adoption in Canada. I fell instantly in love with Lola…”

But his baby joy was short-lived.

McDermott reveals in the declaration that he and Eustace “agreed that I would relinquish my legal rights to Lola, however, based on the fact [Mary Jo] was concerned our separation would jeopardize the adoption.”

But just over a month later, on August 29, 2005, during a pre-planned family trip to Palm Springs,  “Dean McDermott told me he was in love with Tori Spelling,” Eustace says in the documents, “that she was his soulmate, that she loved him unconditionally, and that they had sat down and made a plan. He then said, ‘We will take care of the kids, and money will not be an issue.’”

“I was crying uncontrollably,” Eustace remembers, “and asked Dean McDermott if he was going to divorce me and marry Tori Spelling. Petitioner responded, ‘Yes.’”

After that, she notes, McDermott “signed a release which has been provided to the adoption attorney pursuant to which he has waived all parental rights to Lola.”