[SPOILER ALERT: This story contains sexy details about a scene in 7 Days in Hell, which aired July 11 on HBO.]

7 Days in Hell, a mockumentary that relives the longest tennis match ever played, aired Saturday night on HBO, and it featured an overhead smash of outrageousness: A computerized reenactment of a prison orgy-turned-escape. A line of underwear with a hole for the scrotum to dangle out of. An American badass, Aaron Williams (Andy Samberg), snorting coke right off the grass-court lines at Wimbledon. But all of these naughty bits were topped by some toplessness (and bottomlessness), in the form of a streaker threesome scene.

Let us recap: A female wearing nothing but an apron (a wink to 1996 Wimbledon streaker Melissa Johnson) runs onto the court and up to Aaron mid-match, and after she evades security, he puts his racquet down to help calm her down. Instead of escorting her off the court, though, he starts making out with her. While Aaron’s opponent, Charles Poole (Kit Harington) voices his incredulous protest, Aaron and the topless woman have sex against the wall in front of everyone for four hours, followed by an hour-long session of oral sex on the grass, during which he high-fives her multiple times.

And then things get really weird.

Another streaker bounds onto the court — this one male — and Aaron tries to evade him before giving into the moment and making out with him. After Aaron’s New Age-flourished lovemaking session with the dude, the female streaker returns for more loving and they all engage in a threesome while poor Charles lies down on the court in frustration, waiting for the marathon match to resume.

So … how exactly did this scene come to be? We asked Samberg, who also executive-produced the project to shed light, and not his clothes, on the matter.

Andy Samberg: ‘We didn’t want it to just be gratuitous female nudity for HBO’s sake’

“When Murray [Miller, the writer of 7 Days] and I were brainstorming, he had mentioned this one incident where there was a woman streaker at Wimbledon,” he explains. “We looked it up and it was really a fascinating moment, because it was back when that was a real statement. It was just this young, beautiful woman running across the court and everyone’s laughing and smiling and the officials are all shocked. There’s a bunch of stuff in the [mockumentary] that is loosely based on real events, and with that one we were like, ‘What would happen if that happened in ours?’ Obviously my character would immediately try to have sex with her because that’s all he knows — that’s how he communicates with the world. But we didn’t want it to just be gratuitous female nudity for HBO’s sake. And we wanted it to be an even playing field. So we thought a dude should come next. And we also wanted to show that Aaron Williams don’t discriminate, you know? He’s down with whoever and whatever comes on that court.”

The R-rated ridiculousness of the moment was not lost on Samberg during filming. “That was a crazy scene to shoot — no doubt,” he says. “It’s definitely the craziest thing I’ve ever done in front of 200 extras.”

Not that those extras knew exactly what was coming. Samberg and the producers opted to keep the streaker part a secret in order to capture their genuine responses. “We wanted to see how people reacted,” says Samberg with a chuckle. “I think they were shocked.”

And who came up with that high-five flair while Aaron pleasured the female streaker? “That was me,” confesses Samberg. “I’m not going to say it is ripped from the headlines necessarily, but I like the idea of him getting positive reinforcement the entire time.” Samberg, by the way, was already intimately familiar with the male streaker — it was his pal, Chris Romano. “He is known in our circle of friends for getting naked unprompted,” he says. “So when we wrote the scene, we knew we were going to call him.”