The bombshell videotape that threw Donald Trump’s presidential campaign into turmoil had been sitting on a shelf at NBC, ignored for more than a decade, according to reports.

Until Monday, when one of the producers of the network’s entertainment-news show “Access Hollywood’’ remembered the taping session with the show’s co-host Billy Bush, CNN reported Saturday, quoting an unidentified source.

Executives at the network reviewed it and decided that in light of Trump’s trashing of former Miss Universe Alicia Machado, the forgotten tape could make big news.

It did.

Executive producer Rob Silverstein looked at it and found that Trump bragged to Bush, “When you’re a star, they let you do it. You can do anything . . . Grab them by the p- - -y. You can do anything.’’

It also included Trump claiming to have tried unsuccessfully to get Bush’s co-host at the time, Nancy O’Dell, to have sex with him.

“We were debating what to do’’ with the tape, another NBC source told CNN.

By Friday, the report said, Silverstein decided to broadcast it — but not until Monday, the day after the second presidential debate.

That turned out to be a yuuuge mistake on the network’s part — it got scooped on its own story.

Silverstein soon got the bad news that The Washington Post had somehow gotten hold of the tape.

The newspaper said one of its reporters, David Fahrenthold, had a copy given to him by a source.

The newspaper’s story said the tape was not leaked anonymously; Fahrenthold knows the person who provided it.

Fahrenthold then called NBC for comment.

That’s when the network’s producers got an October surprise of their own, “blindsided” by their own scoop, according to CNN.