The key to “American Bitch,” Sunday’s scathing and timely episode of “Girls,” is the compliments. “Hannah, you’re clearly very bright,” Chuck Palmer, a novelist celebrated for his confessional work, says. “I could tell that from the first sentence you wrote.” He reads the sentence, as Hannah struggles to hide her pleasure: “ ‘If one more male writer I love reveals himself to be a heinous sleazebag, I’m going to do a bunch of murders, create a new Isle of Lesbos, and never look back.’ ” “You’re funny!” Palmer says. “That’s a funny sentence.”

Palmer goes on to call Hannah “a smart woman” and mention her “pretty face” and explain that he invited her to his place—selected above other bloggers and feminist critics—because “you write well, you write sharply.” A New York creative icon, Palmer lives in a grand apartment on the Upper West Side. He has a framed Woody Allen poster: it’s Woody with his head ringed by a medieval saint’s golden halo, holding a gun to his head. He’s got an ex-wife with whom he fights over custody; their biracial daughter plays the flute. He tells Hannah that he once ate so many chocolate-covered cherries that he stuck his finger down his throat. “I’m not perfect, but I’m not saying I’m perfect,” he tells Hannah, the bad boy’s defense. “I’m a horny motherfucker with the impulse control of a toddler.” He feels like a familiar figure.

A middle-aged male artist in the semi-autobiographical tradition of Philip Roth, Palmer is a novelist whose works include “The 9th of July” and “The Dirty Ones”; his home is full of PEN/Faulkner awards and photos with luminaries such as Toni Morrison. Those walls are also filled with photorealistic paintings of the apartment itself: it’s a sly visual reference to the memoir, particularly the twisty, half-denied, half-admitted moral gray area of “creative nonfiction”—a tattletale skill that Hannah, Chuck, and Lena Dunham (and Philip Roth, for that matter, along with most sitcom writers, comedians, graphic novelists, and pop lyricists) specialize in. But online, college girls have been writing their own mini-memoirs about Chuck: scathing Tumblr posts about “non-consensual blow jobs.” Hannah wrote a post about those girls on a “niche feminist site,” condemning Palmer for having exploited his fans. He wants to defend himself, it seems.

Hannah is nervous when she arrives, fixing her lipstick in the gilded elevator, then holding onto her handbag because she doesn’t plan to stay long. But even while the two argue—as he complains to her about witch trials, and how she’s wasting her talent on gossip—he keeps on steadily complimenting her, a drip of sedative, calling her funny, funny, funny. The praise pays off: Hannah relaxes her guard.

Something else happens, of course: “American Bitch” is a trick episode—and while it stands alone, it also serves as a bookend to an earlier “Girls” episode, “One Man’s Trash,” which was also directed by Richard Shepard. That episode, the fifth of Season 2, was about Hannah’s interaction with another middle-aged man who owns enviable real estate: a Brooklyn brownstone. In “One Man’s Trash,” Hannah fell into a dizzy, idyllic, intensely sensual weekend with a lonely, older divorced man, Joshua, and got three days off from her life, during which she was treasured for her youth, took a luxurious shower, got wrapped in a towel and carried to bed when she fainted, played naked Ping-Pong, was given a rare orgasm (one of the only scenes of “good sex” on the show) and, also, listened to. Finally, however, Hannah sabotaged this utopia, accidentally/on purpose: she chattered confessions that made her seem crazy, or at least too unstable to be cute. It was a private encounter, the kind that only the two people involved could understand. It ended with Hannah waking up alone in that bourgeois fantasy house, then acting as if she were an adult: she ate toast, read the paper, made the bed, and, finally, before leaving, acted responsibly, taking the garbage out.

In contrast, “American Bitch” is that story’s poisoned underside: it’s not about healing but humiliation, and the kinds of messes that can’t be cleaned up. As Hannah and Chuck keep moving together, from the foyer to the living room to the kitchen to the bedroom, they have a clever debate, one that is not merely about sexual assault but about fame, money, literary ethics, and the benefits and dangers of the Internet. It’s a power game that’s a little bit Mamet’s “Oleanna,” a little bit Chabon’s “Wonder Boys,” a little bit Apatow’s “Funny People,” with some “Clouds of Sils Maria,” plus the recent “Easy” episode starring Marc Maron. In certain ways, it’s a classic exchange between an older artist (rich, decadent, in print) and a younger artist (poor, moralistic, online). Chuck scores some points: it’s the women who throw themselves at him, he argues, because they are seeking stories to tell. Who really has the power, he asks: the zitty older virgin—him—or a beautiful young model? Hannah resists those arguments; she scores her points, too. “I’m tired of gray areas,” she tells him in disgust, when he waves off any sense that he’s even powerful. She shares a story about having been groomed by a grade-school teacher, another older man who selected her, making her feel chosen and special (a story that’s one of Lena Dunham’s own real-life stories, which she wrote about in her memoir). Chuck sympathizes. Eventually, he asks Hannah about herself—as, he suggests, a form of ethical payback for the exploitative relationships with his fans: he never really listened to the other young women, but now he’ll listen to her, see her as a person, in order to make up for it.

It’s a shady move, one that plays to Hannah’s ego, the part of her that once, high on opium, felt like the voice of her generation. Along the way, Chuck makes her pity him, telling her about how he can’t sleep without pills, how he’s back in therapy, how fearful he is of his daughter finding out about the rumors. He makes Hannah feel like a colleague, an equal. By the time Chuck’s offering Hannah a gift from the shelf in his bedroom, he’s already won. It’s a trap laid by a narcissist for another narcissist. Who among us can say we wouldn’t ever fall for one of those?

The last passage of the episode is a nasty joke that Philip Roth himself would surely appreciate. In the bedroom, once he’s called Hannah funny again and given her that copy of “When She Was Good” (Roth’s novel about a female do-gooder who tries to improve men), Chuck asks her to lie on the bed with him. “I just want to feel close to someone in a way I haven’t in a long time,” he tells her (the line of every nice guy bargaining to spend the night), and then he parodies the language of consent by talking about her staying clothed and honoring boundaries. “Your bed smells like snacks,” Hannah says, lying down, gingerly. “I live alone, lady,” Chuck says—more self-pity, and with it, she folds, and apologizes to him, entirely. Hannah says she’s sorry for writing something uninformed, something that hurt him. Chuck tells her that he’s not angry. And then he adjusts himself, and, in a move that has to be practiced, pulls out his cock and puts it on her thigh.