The rumors emanating from the set of “The Departed,” Martin Scorsese’s remake of the 2002 Hong Kong crime thriller “Infernal Affairs,” had Jack Nicholson doing everything from rewriting script pages on a daily basis to eating bugs on camera and springing sex toys on his co-stars.

The finished film, which opens Friday, proves them all to be true—sort of.

Playing Boston mob boss Frank Costello, Nicholson does, in fact, chomp on an insect, surprise one of his henchmen (played by Matt Damon) with a prosthetic penis and clearly improvises his way through certain scenes. But it all serves to strengthen Nicholson’s performance, adding madness and moral rot to his portrayal of a career criminal who, having amassed all the power and wealth anyone could possibly want, remains in the game for the sheer, sick thrill of it.

The role of Costello is what Nicholson describes as a “short part”: He was on the set of “The Departed” for only 25 of its 99 shooting days. But his presence in the film is felt in every frame, serving as a demonic father figure to both Damon and Leonardo DiCaprio, cast as an undercover cop who infiltrates Costello’s ranks.

And Nicholson’s unpredictability—like suddenly setting fire to a table during a scene in which he is trying to intimidate DiCaprio’s cop—forced his two younger co-stars to stay constantly on guard.

“As far as Jack was concerned, we kind of expected the unexpected,” DiCaprio recently said at a press junket in New York to promote “The Departed.” “For me, there were a number of different scenes where I had no idea what was going to happen. We all knew that he would have to grab the reins with this character and let him be free form, and we all were completely ready for that every day that we walked up on the set. He had a short run, he filmed his scenes and then he left, but those were some of the most intense moments of the film for me, certainly, and as a human being, there were some memories that I will never forget.”

Nicholson, 69, was unable to attend the junket due to a salivary gland infection (“I’m in good shape now,” he says). But he offered to speak to The Miami Herald via telephone from his home in Los Angeles about “The Departed,” his unorthodox approach to his character, his affinity for playing villains and, of course, his beloved Lakers.

Q: Part of the appeal of “The Departed” is watching you act in a Martin Scorsese movie for the first time. Why hadn’t you guys worked together before?

A: Marty and I have known each other for 30 years by now—he’s a film buff, I’m a film buff, we both love movies like crazy and we had always talked about working together. This is just the first occasion that came along where we finally had a chance to do so and we were both extremely enthusiastic about doing it.

Q: When he first sent you the script, though, you turned it down.

A: I don’t even know if it was Martin who sent me the script: I apparently had some contact with it even before that, because I had done a lot of comedies in a row and I was looking around for a nice juicy bad guy to play. But yes, when I first read it, there was no part there. Or at least no part I was interested in. And if I’m not going to do something, I always try to give a fast “no” so I don’t hold people back or string them along or anything like that.

Q: What do you mean by “there was no part there”?

A: I could tell that they wanted me to play it because I would create some impression, even if there wasn’t a part there. But that’s not why I ever play what I call a short part: It has to be something that I’m really interested in doing. Then Leo DiCaprio, who is also an old friend of mine, said “I’d love for this to work out. Would you take a meeting with Martin and the writer William Monahan and I and see if there’s anything we can do?” So we did that, we talked, and things progressed from there.

Q: Was it simply a matter of expanding the role?

A: Yes, it was expanded—I always feel uncomfortable asking somebody to expand the part—but it also got more detailed and became more entertaining, for lack of a better word. We added to it and we also took away. It was a great creative experience. I just had a ball doing it.

Q: I’ve read that the sex toy Costello wears in the movie was also your idea.

A: Yes. laughs I felt that bringing a kind of monstrous sexuality to this particular monster would give him a freshness that you don’t always see.

Q: A lot of that stuff appears to have been cut out of the final version, though.

A: I’ve long felt that people are more frightened about seeing sexuality in movies than they are about seeing death and violence in movies. That is true of filmmakers as well as audiences. I don’t see what happened here as being definitive in that area, but it’s certainly not that much different. Let’s just say there was more graphic monstrous sexuality in the rough cut than there is in the final movie. But you know, that always happens. That’s fine with me. You got the sexual element, didn’t you?

Q: Yeah, it comes through.

A: All right, as long as it’s in there. I’m just an actor—I may want more, I may want less—but like everyone else who makes movies, I serve the director. If Martin is happy, we’re happy. (laughs)

Q: Both Damon and DiCaprio said that you kept them on their toes by doing unexpected things in your scenes with them, almost as if you were menacing them.

A: That’s what they wanted me to help create with this character. A lot of the talk in this movie can be amusing, but basically there’s murder at the bottom of all of it. And the overall theme of the picture is about power and not knowing who to trust. That’s what gives it some resonance.

Q: Some people are going to say you’re just doing your Jack thing, playing another over-the-top villain.

A: That is partially a criticism, partially a compliment. I’ve had some amount of success playing different kinds of characters, but it would be crazy for me to think people wouldn’t know it was “me” playing the part. laughs For instance, the other night I saw a little piece of “The Postman Always Rings Twice.” They would have said the same thing about that, but those are two very different performances and two very different types of murderers. I always try to consider what is the character’s position within the movie is. In “The Departed,” I sort of played Costello as a king gone mad—you know, absolute power corrupts absolutely.

Q: You once told an interviewer who asked you why you were drawn to dark characters that “If you saw my work and knew me, you wouldn’t be shocked. I was the toughest kid in the area. I have tremendous violence in me.” Is that still true?

A: Only until I was 13. The first time I got my a—kicked, that was all over. (laughs)

Q: But you certainly have an unusual affinity for playing villains, or at least dark characters.

A: Maybe I’ve played more than the average leading actor, but mostly because a lot of those projects, because they were dark, might not have been able to get into production if they didn’t have someone like me involved. That’s why I tended to movies like “Ironweed” or “Postman,” which have a gritty, tough core to them. They’re not meant to be lovable movies as such. Early on, I felt that was something I could contribute to movies I was involved in. And, of course, dark characters are fun to play. laughs

Q: A lot of people often say Scorsese has never won an Oscar because his best movies are too dark for the tastes of Academy voters. But you’ve won three of them, and you’re not exactly Mr. Sunshine.

A: I’ve been very lucky in that area, as you say. I agree with you: It’s a bit harder to win with dark things than with more easily accessible things. But another big factor has to do with who else is nominated. We got a record number of nominations for “Chinatown,” and we only won one Oscar. And Stanley Kubrick never won an Oscar, to put that in proper perspective.

I think Martin feels the same way about it as I do: It will happen when it happens. I’d love to see him get it. This movie is certainly representative of his work and I think it’s also dang entertaining, so I wouldn’t be shocked if this was his time around. Gosh, who wouldn’t like to win an Oscar? But other than that, Martin just likes making movies, he gets to make them and we’re all the better off for it.

Q: Speaking of the Oscars, you looked surprised when you were handing out the Best Picture Oscar last year and Crash won.

A: I was a little surprised, yeah. When you’re not personally involved in the so-called Oscar race, you don’t follow it as closely as you do if you’re in it—which you always want to be in, because it’s always good for the picture. But I hadn’t followed it much, and whenever I danced past entertainment news, I had a feeling, like a lot of people, they were going to go for a picture other than that. But I didn’t have that strong a feeling about it: I happen to have liked “Crash” very much.

Q: You became a star after “Easy Rider” premiered at the Cannes Film Festival in 1969. Why do you think you’ve been able to maintain your popularity for so long, especially in an industry where actors fall in and out of favor with each succeeding generation?

A: I can’t say I’ve never wondered, but there’s no point in wondering about it for too long, because you’re not going to know. It’s just the luck of the draw. If I had anything to do with it myself, I’d say that I’ve been lucky enough to work with good people. The good directors hire good people across the board, and that’s the underpinnings of a good movie. In other words, it’s probably just been good taste on my behalf. I was also 32 years old when “Easy Rider” came out and had been making movies for a long time already, so I got to make most of the more glaringly embarrassing errors that an actor makes in relative obscurity. (laughs)

Q: Since you’re the world’s most famous L.A. Lakers fan, I gotta ask you if you watched Shaquille O’Neal (who split from the Lakers in 2004) and the Miami Heat win the NBA championship this year.

A: Yeah, I watched them. That whole conflict was the toughest thing on any sports fan. You know, here in L.A., we only play for the championship. And we knew a couple might have gotten away from us for reasons that we don’t always respect in the sports world. We want people who want to win and play for a championship, and whenever someone gets between that and the fan, we are not happy. But I’m happy for ShaQ: He got one in there.

America Lost and Found: The BBS Story leaves no doubt that BBS Productions was one of the most important players in a cinematic revolution. These seven films make a case for keeping the canvas wide and the road open.