The biggest hurdle faced by The Righteous Gemstones is expectations. Created by Danny McBride (who produces alongside his partners-in-absurdity, directors Jody Hill and David Gordon Green), this HBO comedy about a family of dysfunctional televangelists appears, on the surface, to be a spiritual companion piece to its creative team’s Eastbound & Down and Vice Principals. Yet while it often echoes those predecessors’ themes and tone, as well as features some of their primary players (including Walton Goggins, hallelujah!), the latest from McBride and company is cut from a different cloth. There’s plenty of humor to be found here, but—in a twist bigger than any of its narrative right-turns—there’s also considerable heart.

In other words, come for the full-frontal gags—of which there are so, so many—and stay for the surprising pathos.

To a far greater extent than either of McBride’s past two HBO efforts, The Righteous Gemstones (whose hour-long premiere airs Sunday, August 18, with half-hour installments to follow) is a melancholy character study. You’ll be forgiven, however, for not recognizing that from its early action, which is pitched in a typical McBride register. As Jesse Gemstone, the gray-mutton-chopped eldest son of an insanely wealthy clan of preachers led by paterfamilias Eli (John Goodman), the star indulges in his usual array of bad behavior—casual misogyny, nasty selfishness, petty bile, and profane wild-man nonsense. Once again, he’s toxic masculinity personified, albeit in a holy-man guise that accentuates his—and his relatives’—fundamental hypocrisy.

Jesse is married to devoted Amber (Cassidy Freeman) with three kids, although their eldest, Gideon, has run away to Los Angeles to fulfill his (to Jesse, traitorous and godless) dream of becoming a Hollywood stuntman. More immediate sources of discomfort come in the form of younger brother Kelvin (Adam Devine), a faux-hawked youth minister with a quasi-homoerotic relationship with his converted-Satanist buddy Keefe (Tony Cavalero), and sister Judy (Edi Patterson), who’s been denied the Gemstones limelight because she’s a woman, much to her bitter discontent.

Manning the entire mega-church operation is Eli, played by Goodman as a celebrity who smiles for the cameras and scowls like a tyrant behind closed doors—as well as in the face of rivals like John Seasons (Dermot Mulroney), the pastor of a local congregation that Eli freely admits he plans to usurp. Eli is still grieving the death of his beloved wife and partner-in-televangelism, Aimee Leigh (Jennifer Nettles), and Goodman is thus decidedly restrained in the role, his Eli hovering over the proceedings like a god wracked with sorrow and disappointment over that which he’s lost, and the clowns with whom he’s been left.

Calamity arrives courtesy of a hidden-cam video of Jesse and his buddies snorting coke and partying with prostitutes. This attempt at blackmail is orchestrated by a shadowy figure in a devil mask, who demands $1 million in cash. For a McBride character, it’s a familiar dirty-deeds dilemma, and it compels Jesse and his siblings to take drastic action in order to prevent the footage’s release, which would undoubtedly destroy the Gemstone empire. It also establishes one of the series’ favorite images: that of a naked penis in close-up. That sight is seen so frequently that McBride’s sheer commitment to the puerile gag becomes downright impressive, not to mention increasingly amusing.

Jesse’s response to this scheme invariably goes awry in ways both violent and stupid, and his circumstances are further complicated by a second-episode bombshell not to be divulged here. More interesting than that insanity, however, is The Righteous Gemstones’ mounting focus on deepening its initially two-dimensional types. Sacrilegiously bickering with his older brother, Devine’s Kelvin is a prototypical man-child who reveals layers of goofy earnestness once his dad gives him greater ministry responsibility. Patterson’s Judy similarly begins as something of a one-note joke, replete with a namby-pamby fiancé named B.J. (Tim Baltz) who’s rightly dismissed by the rest of the Gemstones as a loser, but she blossoms into a more fully-formed human in a sixth episode that focuses on her resentment at her dad’s (sexist) dismissal of her as an also-ran.

The Righteous Gemstones’ true ace is Goggins, sporting a fluffy mane of snow-white hair and shiny matching veneers as Baby Billy Freeman, the ne’er-do-well brother of Aimee Leigh. Despite being a brazen me-first con man, Baby Billy is hired by Eli to run his new church set in a mall (where a Sears used to be located), and their combative rapport turns out to be central to the show, as illustrated by a fifth episode flashback to Eli and Aimee Leigh’s earlier married days that reveals the root source of the two men’s rivalry. That installment is almost completely devoid of jokes, and the shift—especially coming on the heels of some trademark McBride madness—is downright jarring. Yet thanks to the assured stewardship of director David Gordon Green, it’s pulled off with aplomb, providing a foundation for Eli’s consuming despondence, Baby Billy’s conniving, and Jesse and Judy’s immature entitlement.

While at first glance, Goggins’ Baby Billy is just another in the show’s long line of two-faced devout caricatures, his smarmy routine is fleshed out with enough nuance to make one empathize (if not sympathize) with his plight—even as it maintains requisite cartoonishness to keep things funny. The Righteous Gemstones’ religion-as-big-business satire isn’t particularly sharp; the notion that evangelical leaders might not practice what they preach is hardly a revelation. Fortunately, its more ridiculous inclinations help compensate for that shortcoming, especially via peripheral figures such as Keefe (a quiet-talking loon with a 666 tattoo on his chest and possible romantic feelings for Kelvin), Baby Billy’s ugly-toothed simpleton wife Tiffany (Valyn Hall), and B.J., whose wimpy subservience to everyone around him (including sexually-aggressive Judy) generates consistent laughs, and seems ripe for greater exploitation.

Where the series ultimately thrives, though, is in its characterizations, which transform in unexpected ways over the course of the first six episodes (which were all that was provided for press). Upon first introduction, it’s hard to imagine actually feeling something genuine for these phony, mean, self-centered buffoons. But lo and behold, that’s exactly what happens—a turn of events so shocking, it comes close to qualifying as a honest-to-goodness miracle.