Larry David has revealed that he was willing to quit Seinfeld if NBC executives didn’t let him make the controversial episode, “The Contest”.

David wrote the season four episode about a competition between Jerry, George, Elaine and Kramer to see who could go the longest without “pleasuring” themselves.

As the Seinfeld co-creator told Vulture, the storyline was based on an similar contest he had with a friend.

“I don’t remember what the bet was,” David said. “There must have been some money involved. I think it was a small amount. [The contest lasted] two days. Maybe three. I just remember it didn’t last very long. I was surprised at how quickly it ended. I won handily, yes.”

David said he’d neglected to mention the idea to Jerry Seinfeld for the first few years of the show because he didn’t think NBC would ever let it get made.

But when he eventually told his comedy partner, Seinfeld was “all for it”.

The two creators of “the show about nothing” kept the storyline a secret from the TV executives until all the actors gathered to do a table read of the script.

“I remember being nervous because the NBC executives were there,” David told Vulture.

“I really had this thing going on in my head where, ‘well, if they don’t like it, I’m just going to quit the show.’ I really had this built up in my head where, ‘there’s no way they’re going to do it and I’m just going to quit if they don’t do it’.”

But David’s fears turned out to be unfounded as the majority of the executives had no issues with the episode, particularly because the word “masturbation” wasn’t mentioned in the script once.

“That was Jerry’s idea from the get-go,” David explained.

“He said let’s not mention the word. It turned out to be a great idea. I had it in the first draft and he took it out.”

When the episode first aired in the US 25 years ago, NBC received less than 65 complaints from viewers angry about the subject matter. They also received 30-odd calls complimenting the show.

“[The show] was always popular, but I think it hit another level after that,” David said.