Tim Allen has denied Pamela Anderson’s allegation that he exposed himself to her on the set of “Home Improvement” when she was 23 and he was 37.

The “Toy Story” actor refuted Anderson’s account Sunday in a statement to Variety, which published an excerpt from the “Baywatch” star’s forthcoming memoir detailing the alleged encounter.

Model-actress and activist Pamela Anderson . Joel C Ryan/Invision/AP

“No, it never happened,” Allen told Variety. “I would never do such a thing.”

In her highly anticipated memoir, “Love, Pamela,” Anderson claims that the incident occurred in 1991 on her first day of filming the hit ‘90s sitcom starring Allen as a bumbling dad and handyman. Anderson played “Tool Time girl” Lisa in the first two seasons of “Home Improvement” before leaving the show to work on “Baywatch.”

“I walked out of my dressing room, and Tim was in the hallway in his robe,” Anderson writes in the excerpt obtained by Variety.

“He opened his robe and flashed me quickly — completely naked underneath. He said it was only fair because he had seen me naked. Now we’re even. I laughed uncomfortably.”

Representatives for Allen did not immediately respond Monday to The Times’ request for comment.

Anderson’s new book details her upbringing on Canada’s Vancouver Island and her rise to superstardom, as well as her thoughts on the acclaimed Hulu series “Pam and Tommy” starring Lily James as Anderson and Sebastian Stan as her ex-husband, rock musician Tommy Lee. The memoir is scheduled to arrive Jan. 31.

Comments are not available on this story.