The screw-up at the end of the Academy Awards ceremony wasn’t the only big TV moment that had tongues wagging on Sunday night.

HBO’s “Girls” featured a candid — really candid — performance from guest star Matthew Rhys, star of FX’s “The Americans.” The episode, “American Bitch,” featured Rhys as Chuck Palmer, a writer with a well-earned reputation for seducing impressionable young literary hopefuls. Palmer and Lena Dunham’s Hannah Horvath square off after he finds a critical piece that she penned about him, citing him as a writer she once admired. The entire half-hour takes place in Palmer’s Manhattan apartment.

The “Girls” and “Americans” production teams have been friendly over the years as both shows shoot in Brooklyn. Rhys noted that “Girls” exec producer Jenni Konner recently wrote a “very, very nice” appreciation of “The Americans.” But Rhys was suggested for the role of Palmer by script supervisor Kim Delise, who has worked on both “Girls” and “The Americans.”

“Disturbingly, when Lena said ‘I have this script about a sexual predator slash pervert,’ Kim Delise went ‘Oh my god, Matthew Rhys would be perfect,’ ” Rhys told Variety.

The episode was filmed last summer, not long after Rhys and Keri Russell, his co-star in “The Americans” and in life, had their first child together, son Sam. The unruly beard that Rhys sported for the role of Palmer was “purely because we just had Sam and I couldn’t be bothered to shave.”

Even for a show that has been as sexually frank as “Girls,” the “American Bitch” episode featured the surprising moment when Palmer pulls out his flaccid penis as he and Dunham lie together, fully clothed, on a bed. There’s not much left to the imagination in the scene, shot from overhead.

Rhys enjoyed the departure that “Girls” offered from his role as the conflicted, cunning spy Philip Jennings on “The Americans.” But he wants to make one thing clear about his work on “Girls”: “It was a prosthetic.”