Fans can't stop gushing about awesome, and R-rated, "Logan" is. And it's all because of James Mangold.

The director and co-writer of Hugh Jackman's last turn as Wolverine recently told Moviefone how he got away with making one of the best, and most R-rated, comic book movies ever made. Especially that scene where a little girl gets harpooned right through the heart.

He also revealed how he and his co-writer pulled off two of the film's best emotional moments -- so emotional, they might make you cry.

Moviefone:"Logan" is great. I love how it -- the action -- everything comes from a character-first place. And I can't believe you got away with so much R-rated stuff.

James Mangold: Me too!

Was there ever any push-back from the studio on some of the more violent beats? Like, that first fight with X-23 -- did they ever say "um, does this little kid have to get harpooned through the heart?"

[Laughs]. I think if we had previewed or tested the movie, and audiences rejected the movie on the basis of violence, I think we probably would have gotten some push back. But when we tested the film, the audiences were like: "AWESOME!" The reality was that, we hit a vein; something that audiences really wanted to see -- which was a totally feral lead character, who is famous for his berserker rage... it just seems logical that you would allow him to exhibit that rage. If for no other reason to let it finally be felt for the audience.

And I think another reason we succeeded with the film, and with the studio is that -- death is not trivial at all. There are lots of PG films, comic book movies, where people are getting mowed down by the dozens and they have no names. They're just people falling from building tops, and this movie -- it feels the loss of each and every one of its characters, with a kind of finality that is different.

To that end, two beats I love in this movie are: One, where Xavier is mumbling "I'm sorry" to the people in the Oklahoma City casino that are victim to his latest seizure. And two, one of Wolverine's great, last lines -- "This is what it feels like." Can you walk me through how you came up with those?

"This is what it feels like" was -- that was written by (screenwriter) Scott Frank. He was my writing partner on this, and when he wrote it, I was just like: "Yeah, that's perfect." And the "I'm sorry, I'm sorry" beat just seemed obvious and logical to us, you know? And it was heartbreaking. Because it's -- once you get into the skin of these characters, in the twilight moment of their lives -- losing control of their powers, and in the case of Charles, a degenerative brain disease -- it becomes really interesting with writing the dialogue and getting under the skin of these characters becomes a really interesting proposition.

The side-story involving the farmer played by Eriq LaSalle and his family are people he cares about... I can't imagine getting away with that in a big studio tentpole like this.

We had concerns about it -- I had concerns. When I was writing it with Scott, we got to it and were like: "This is like a whole [mini] movie within this movie." But it very much fit the model of the kind of road picture we were talking about, where very often, characters will have this very full, mini three-act experience in the middle of this story. So we just went for it. And again, we never got in trouble.

DF-09788 - Hugh Jackman as Logan/Wolverine in LOGAN. Photo Credit: Ben Rothstein.How much of your original pitch ended up in the final film? What were the big emotional tentpoles you wanted to thread the action through?

I pitched them that Wolverine would die, that Charles would die. And, in between, there would kind of be this "Little Miss Sunshine" road trip, with them driving across the country. And I pitched them that X-23 would be in the movie.

When I finished the last one, and started thinking about the script for this one -- one of the major ideas for me was to have Logan confronting the things he is most frightened of, which, in a nutshell, isn't death or the destruction of the world... but was just, love. And intimacy. Those things he finds impossible to do.

And that's something his movies haven't explored as deeply as this one. And the fans, I think they want to see that. They deserve to see that in all its R-rated, but nuanced, glory.

In between all the exciting action and fights, it becomes this mediation on a character who is steadfast in his refusal to love. Because, like he says in the movie, "bad sh** happens to people I care about.

"Logan" hits theaters Friday. Get your tickets now.