PARK CITY - From the first line of dialogue in John Michael McDonaugh's second feature "Calvary," it's clear we're in for a very compromised comedy indeed: as rural Irish priest Father James (Brendan Gleeson) sits impassively in his dim confession booth, an unseen male parishioner bluntly says, "I first tasted semen when I was seven years old." The words are so ugly, so out of step with their serene surroundings, that a large proportion of the Sundance audience responded with a queasy laugh, as if it were a dirty joke cracked at a funeral. But it's no joke at a holy man's expense; it's an admission, and as its implications become clear, tied to the uncovered legacy of sexual abuse in the Catholic Church, silence takes over.

If we come into "Calvary" -- acquired today by Fox Searchlight Pictures -- expecting easy laughs, that's partly because McDonagh's first film, the Gleeson-starring cop comedy "The Guard," was such a black-hearted riot, and partly because irony has rather become the default approach to religious matters in contemporary art. The sincerity of "Calvary's" investigation into the endurance of faith in a world increasingly tilted against it makes the film unfashionable; the fierce gallows humor with which it conducts said investigation makes it a prickly proposition to believers and agnostics alike.

That ugly confession is followed by an ugly threat -- well, a statement of intent, really. Having revealed that he was raped repeatedly over his childhood by a now-deceased priest, the victim announces matter-of-factly that he plans to seek retribution by killing an innocent one -- Father James, specifically -- in exactly one week's time. The cruel logic of taking a good man's life in the name of a guilty man's one is just one of the film's rich, tangled lines of philosophical and theological argument, teased out in McDonagh's poetic, unapologetically wordy screenplay; ideas are narrative in "Calvary," with the Agatha Christie-style whodunnit of Father James' search for his imminent killer a mere supporting framework.

The suspects are numerous, as the County Sligo village in which the film is set turns out to be, of course, a veritable hotbed of sin and hostility -- in the grand tradition of small community-based narratives where all is not as it seems. Much of the film, indeed, plays as a warped, parallel-universe inversion of that hoary parish sitcom "Father Ted."

One by one, the villagers are given a chance to tell their variously unhappy stories: the local butcher (Chris O'Dowd) is being cuckolded by his openly promiscuous wife (Orla O'Rourke), who's having it off with an Ivory Coast immigrant (Isaach de Bankolé), while a young, woman-shy nebbish (Killian Scott) plots an escape to the army. A police inspector (Gary Lydon) enacts suppressed desires with a young rentboy, an American writer (M. Emmett Walsh) in declining health plots his suicide, a hardline-atheist doctor (Aidan Gillen) watches life come and go with bitter detachment, and so on and so forth.

The contrivances are as thick as the Irish brogues, but naturalism is far from the objective here: each encounter is the starting point for a heady moral argument, as Father James argues patiently for the value of the Church, and of faith in general, in a society increasingly -- and, painfully, not without cause -- distrustful of the institution. His troubled daughter (Kelly Reilly, tissue-delicate and profoundly affecting) is also among the skeptics, though she wants to believe more than most.

His killer lurks somewhere in the fray, though Father James isn't much more urgently concerned about his fate than the film itself; the unmoored souls of those around him cause him greater concern. He's a spiritual man, but not a sanctimonious one, and Gleeson, giving even more of himself than he did to "The Guard," plays him with exquisite authority: that much-folded hangdog face registers both his hard-won personal peace and the exhaustion of years spent fighting against the popular current. He delivers McDonagh's sculpted words -- akin more to prose than dialogue in many scenes -- with classical heft, but is no less compelling an onscreen listener.

The material may veer too far into portentousness for some tastes, though it's hardly self-serious or disingenuous. Stabs of vicious comedy notwithstanding (it's not every ecclesiastical drama that includes references to felching), "Calvary" pursues humane lyricism at every turn -- not just in its passionate language, but in the austere compositions and ravishing color saturation of Larry Smith's cinematography. (It evokes his work on Nicolas Winding Refn's "Only God Forgives," with which "Calvary" would make a curiously apt screening partner.)

A more critical error, to me, is a practical one: some viewers will find the confessor's voice in the opening scene so immediately identifiable as to make Father James' investigation perversely pointless. Perhaps that's a miscalculation; perhaps it reflects the unproven conviction upon with all religious faith is built. I'm in two minds, but in no respect is certainty a principle advocated by this knotty, compassionate film.