Maybe the tape came in handy after all.

Kim Kardashian believes that the success of "Keeping Up With the Kardashians" can be attributed to the scandal surrounding her 2007 sex tape with her then-boyfriend, Willie "Ray J" Norwood.

"Do you feel that the show would have had its massive initial success without the publicity that surrounded the sex tape?" Andy Cohen asked the Kardashian family point blank during the reunion taping on Thursday.

"Looking back, probably not," Kardashian, 40, admitted.

KIM KARDASHIAN WON'T CHANGE HER ‘SEXY’ STYLE WHEN SHE BECOMES A LAWYER: ‘YOU CAN DO WHATEVER YOU WANT’

She also "absolutely" thought about what she would say if her kids — North, 8, Saint, 5, Chicago, 3, or Psalm, 2 — asked her about it.

The Tonight Show Kim Kardashian

Kim Kardashian said that 'Keeping Up with the Kardashians' ‘probably’ wouldn't have seen so much success if it weren't for her sex tape with Ray J. (Getty Images)

"I haven’t had to as of yet and luckily I think that so many years have gone on and so many things have happened positively that it really erases that," she said. "It is something I have to live with for the rest of my life."

She added that she believed "everything happens for a reason" and that she learned a lesson from the scandal, even though she wishes she could "erase" it from the "stupid things" she’s done in life.

Kardashian and Norwood, now 40, made the tape with a handheld camcorder while in Cabo to celebrate Kardashian’s 23rd birthday in 2002 and it was released by Vivid Entertainment as "Kim Kardashian, Superstar" five years later.

CLICK HERE TO GET THE FOX NEWS APP

She later confessed to taking ecstasy before filming the tape.

Meanwhile, "KUWTK" premiered in 2007 and is ending its 20-Season run on Sunday.

CLICK HERE TO SIGN UP FOR OUR ENTERTAINMENT NEWSLETTER

The second part of the "KUWTK" reunion will air on Sunday at 9 p.m. ET.