Thomas Haden Church and Sarah Jessica Parker in “Divorce.” (Craig Blankenhorn/HBO via AP)

Sunday night on HBO felt uncannily familiar — if only for a second. After HBO’s signature static intro, viewers were met with the sight of Sarah Jessica Parker, staring into a mirror wearing nothing but a towel.

“Sex and the City” fans probably rejoiced. Twelve years after that game-changing show went off the air, Parker is back with another half-hour comedy on Sunday nights that delves into women and their relationships.

But it didn’t take long to realize that “Divorce” is something very different — something much darker.

That’s not to say the show is bad. It very effectively gets across the pain, acrimony and exhaustion that comes with splitting up. But anyone expecting “Sex and the Suburbs” was bound to be disappointed.

In “Divorce,” Parker plays Frances Dufresne, a married mother of two who has come to loathe her husband, Robert (Thomas Haden Church). During that first scene, he tries to explain how selfish it is for his wife to hog the bathroom, and what the dire consequences are: He had to relieve himself in a coffee can in the garage. She doesn’t so much as look at him, responding with a few “uh-huhs” as if she’s making a point of only half-listening. Then, as he walks away, she throws up her middle finger. The apathy she shows in his presence just barely hides her rage.

Later, when the couple is at their friend’s 50th birthday party, the guest of honor, Diane (Molly Shannon), gets into a nasty fight with her husband Nick (Tracy Letts) and ends up pulling a gun on him. She doesn’t actually shoot him, but the commotion is enough to give him a heart attack, and he ends up hospitalized in a coma.

Thomas Haden Church and Sarah Jessica Parker in “Divorce.” (Craig Blankenhorn/HBO)

The scenes are strangely reminiscent of a standout “Sex and the City” episode, “Splat!,” which also takes place at a party that ends with a grave turn. In that episode, Carrie runs into her old friend Lexi (Kristen Johnston) at a swanky soiree in the sky-high apartment of her editor. Lexi is 40 and single, and she still likes to live it up — drinking too much and snorting cocaine alone in the powder room. She laments how the people around her have grown up and settled down, and she’s sad to hear that Carrie has paired off with Aleksandr (Mikhail Baryshnikov). Exasperated, Lexi makes a show of wrenching open the window so that she can smoke (against the hostess’s wishes), then she delivers a blistering tirade about how lame New York has become. “What happened to fun?” she demands. “God, I’m so bored I could die.” Just then, she trips on her high heel and falls out the window to her death.

At the end of the episode, the bitter, angry pessimist is dead. By contrast, everyone on “Divorce” is bitter and angry. Lexi’s death emboldens Carrie to drop everything and move to France. She’s hopeful for a fairy tale romance that seems totally within reach. In “Divorce,” Nick’s heart attack inspires Frances to dump Robert. You could say it’s also a kind of hope — that she’ll be happier alone or that she’ll find someone new. But optimism is in short supply on the show, because happy marriages don’t exist in this universe. In addition to Diane, Frances’s other close friend, Dallas (Talia Balsam), is a divorcee, who warns Frances not to expect much from a dating scene filled with castoffs and widowers still in love with their late wives.

“Divorce” is almost suffocatingly bleak at times. It even takes place in the gray, cold dead of winter. But the show is still funny on occasion. It was written by Sharon Horgan, after all, the hilarious Brit who co-writes and co-stars in “Catastrophe.”

One of the funnier jokes in the first episode is the sight of a handcuffed Diane being escorted out of her party while assuring everyone in the house that they should stay put and open another bottle of Champagne. She’d hate to break things up early, she insists. Overall, the comedy in “Divorce” is harder-edged than “Sex and the City,” and that may have something to do with casting. Horgan has a light touch, so even when she’s saying terrible things on “Catastrophe,” her bright delivery softens the message. Parker, who is undoubtedly affecting in the new series, doesn’t have the same sense of innate levity.

The show isn’t always easy to watch. If “Sex and the City” was a good way to counter the Sunday night blues, “Divorce” is something else entirely. It’s still a worthy half-hour — but only if you properly manage expectations.

Read more:

Fall TV preview 2016: What shows you should watch