Brendan Gleeson worked with a McDonagh as long ago as 2008—on “In Bruges,” the debut feature of Martin, the playwright turned filmmaker. It wasn’t until 2011 that the actor starred in “The Guard,” the debut feature of Martin’s writer-director brother John Michael.

“I didn’t really know him that well before we did ‘The Guard,’” McDonagh said in a recent Dallas interview. “I think I’d met him during the screening of ‘In Bruges,’ but it was during the filming of ‘The Guard’ that we became friends.

“We were talking about [working together again] as we were coming to the end of shooting ‘The Guard,’ McDonagh continued. “He said, ‘What do you want to do next?’ because we’d gotten pretty friendly on the movie. And I just said I had this idea for a movie about a good priest. And he said, ‘Oh, I had a good priest who was a mentor to me when I was young.’ But of course this was a drunken conversation in a bar, you know? I woke up with a hangover, and Brendan’s off to do another job.”

But that discussion ultimately resulted in “Calvary,” in which Gleeson plays a priest who must endure a week of struggle when a parishioner uses the confessional to threaten to kill him in precisely seven days in retribution for having been molested by another priest as a child. Father James tries to discover which villager made the threat while struggling with his own personal demons until the time of reckoning arrives.

“Calvary” was shot in County Sligo on the rocky northwestern coast of Ireland, an area of forbidding natural beauty that means a great deal to McDonagh. “‘The Guard’ was set where my father’s from, Galway,” he explained, “and this [Easkey] is where my mother’s from. I knew both locations. I think if you get the location right in a movie, it’s like an added character, you know? And also, most Irish movies are set around Dublin, which I find quite boring—it’s always about the same types of characters. And I’m sure we’re all fans of those sixties and seventies [American] movies where they got out of New York and L.A. and went to other sections of the country. So I was trying to bring Irish cinema, Irish filmmaking out of Dublin and actually go on location somewhere else, so that we can see images we haven’t seen before. I don’t think we’ve ever seen that big mountain…before, and it’s a really brooding presence in the movie.”

McDonagh reflected on his film’s connections with both the Hollywood films he loves and Catholic ritual. “I always love to have a kind of mythic element,” he said. “You could call [this] a western, in structure—a lone man in town trying to do the right thing, surrounded by overwhelming forces, or evil forces. When you get out of the city, out to those big landscapes, it gives it a mythic element.” But he also saw the story’s relation to the medieval passion play: “What we’re seeing is a small-town priest turning into almost a saintly figure, or again into a mythic figure. I did have that in my mind, yes. I like to have a structure in my mind. I was originally thinking of the Stations of the Cross, but I think there are twelve Stations of the Cross, and I thought that would make for a really long movie, a three or four-hour epic. So I thought of another structure, kind of loose—the five stages of grief…denial, anger, bargaining, depression and finally acceptance or hope. I switched them around a little bit—it’s a loose structure—but at least it gave me a process I could move through.

“[The writing] took nineteen days. But I usually think about a script for about six months before I sit down to write. I always know the first twenty minutes of the movie and the last twenty before I actually sit down. I’ll write through a day, and the next day I’ll reread it and maybe tweak a few things here and there, and prepare for the next day. So it’s one day on, one day off. So you can say it’s nineteen days, but it’s double that. I like to do it fast.”

In addition to Gleeson, “Calvary” features a number of other actors from “The Guard.” “I like using actors I worked with before—the idea of a repertory company, like John Ford and Preston Sturgess, who use to have the same people,” McDonagh explained. “And I like what a lot of novelists do, where they’ll write a series of short stories or novels where they’ll have a supporting character in one become the main character in another. So I like the fact that these characters are going to recur. In the third [part of the trilogy—which might be shot in Texas], some of the characters from ‘The Guard’ and ‘Calvary’ will pop up again. The films are all in the same universe.”

One actor in “Calvary” new to McDonagh’s world is Chris O’Dowd, who plays the village butcher. McDonagh saw him hosting an awards program for independent British films, and the routine struck him as perfect for the part. “He was drinking whiskey throughout the awards,” McDonagh remembered. “He was funny all the way through, but as he was getting into the latter half he was being very acerbic about the people who were winning. And I thought that was very interesting—he’s a funny guy, but there’s obviously a barbed wit underneath.”

McDonagh pointed to one bit of misdirection viewers of “Calvary” will have to do deal with—the fact that the voice in the confessional at the film’s start is not actually that of the person eventually revealed as the would-be killer, but that of an actor who’s otherwise not in the picture at all. “I was trying to find other filmic references where that was done before,” he said. “And the only one I could find was David Fincher’s ‘Zodiac.’ In that movie, when the killer calls in, Fincher doesn’t use [the] voice [of the actor who turns out to be the murderer]. So I thought, well, if it’s good enough for Fincher, I’ll do it.

“But one critic [at Sundance] said the film had one flaw—the voice is so distinctive, it spoiled the ending! So then I thought I’d made a flawless movie.”