TMZ has learned Lorenzo Lamas went absolutely ballistic on Shauna Sand this morning -- unloading a verbal assault on his baby mama over her sex tape ... but unlike the porn, it was Shauna who got the happy ending in this story.
It all went down at Lorenzo's house -- after Shauna dropped off their three young daughters, per the former couple's custody agreement. Sand tells TMZ Lorenzo was furious over the existence of the sex tape -- and Shauna was extremely worried that the "Renegade" star would wage a legal fight to get sole custody of the kids.
But Sand claims he eventually calmed down, told Shauna that she was a good mom -- and promised not to battle her for custody. To prove it, Sand says Lamas grabbed a pen and a sheet of paper ... and drafted the following statement: I, Lorenzo Lamas, will not seek custody of my minor children with Shauna Sand.
Even in the event of a release of a sex tape with her and her boyfriend.