It’s somewhat ironic that Martin Scorsese’s most admired film in years happens to be based on a popular Hong Kong action-thriller and set in Boston.

Unlike his other works in similar genres, including “GoodFellas,” or his recent Oscar nominated epics “The Aviator” and “Gangs of New York,” “The Departed” isn’t a longtime passion project for the director, nor is it set — or even partially set — in the familiar milieu of Scorsese’s beloved Gotham.

The project came to Scorsese through Plan B and Warner Bros., who had commissioned scribe Bill Monahan to write an English-language redo of HK hit “Infernal Affairs.”

“Marty thought it would be completely in his wheelhouse,” explains producer Graham King. “He saw it as a cross between a British noir crime thriller and an old-fashioned gangster movie. He just really liked Monahan’s work. He definitely felt this was something he’d have a lot of fun with and show the world his way of doing a crime thriller, with the dialogue and the characters and surprises you see.”

Scorsese, who famously isn’t available for comment this kudo season, explains his attraction to the material in the film’s press notes: “When I received the script, it took me quite a while to read through it because I began visualizing the action and getting into the nature of the story and the characters. One of the things that hit me was that the depiction of the characters and their attitudes toward the world in which they live was so uncompromising. That’s what really got me interested in directing the movie.”

Those characters were played by a cast that included Jack Nicholson as a mob boss, and two young police officers with opposing loyalties, played by Leonardo DiCaprio and Matt Damon.

“As an actor, I knew Leo would convey the conflict of a young man who has gotten himself into a bad situation and then wonders what the hell he is doing there. You can see it in his face; you can see it in his eyes. That’s one of the reasons I like working with Leo; he knows how to express emotional impact without saying a word,” Scorsese says.

“The Departed” marked the first time Scorsese and Nicholson worked together. “Jack and I have known each other for 30 years,” says the five-time Oscar director nominee. “For some reason, we had never quite connected on a movie, so I thought it would be interesting to see if he had any desire to take on the role of Costello. It may have taken a long time, but it was worth the wait, because we had quite a time together on this picture. Jack really made the character his own.”

“It was pretty amazing to see Marty and Jack go at it — two old pros,” says King, noting the helmer and thesp created some wild enhancements to Nicholson’s character.

“The two of them were putting their heads together and coming up with these great ideas. But dildos — huh? That was a great call to the studio that night: ‘Guess what? We used a dildo.’ But you’ve got to have faith in Marty when he shoots.”

Of all the “extraordinary elements,” that go into the making of a film, Scorsese explains, “the one I tend to rely on most often to tell the story is the cast. To have the actors we had in this film all together was remarkable.”