LOS ANGELES (Hollywood Reporter) – In a highly unusual public rebuke of a former A-list movie star, Warner Bros. has dropped Mel Gibson from the cast of “The Hangover Part II.”

Gibson, whose anti-Semitic, racist and misogynist rants have made him radioactive in some Hollywood circles, was to have a cameo as a tattoo artist in the sequel to the 2009 hit.

But the stunt casting, which was picked up by the media this week, triggered an internal backlash at the studio and on the film set. And the studio, where Gibson reigned as a major star during the ’80s and ’90s with such movies as the Lethal Weapon series, decided to go public with a statement that the actor was no longer involved in the project. Gibson’s spokesman declined comment.

Zach Galifianakis – who is reteaming for the sequel with Bradley Cooper, Ed Helms and Justin Bertha and director Todd Phillips – appears to be among those who objected to Gibson.

In a Comedy Death-Ray podcast released last week, Galifianakis alluded to trouble on the set of “Hangover II,” without naming the film. Interviewed by host Scott Aukerman, he said he was in “deep protest” and “up in arms” about a film he’s working on.

Without naming names, he said: “A movie you’re acting in, you don’t have a lot of control; you just show up and vomit your lines out. I’m not the boss. I’m in deep protest right now about a movie I’m working on, up in arms about something. But I can’t get the guys to (listen). … I’m not making any leeway.”

Pressed for details, Galifianakis said: “It has something to do with a movie I’m working on, yeah. I’ll tell you about it later. It’s very frustrating.”

Reps for the actor declined comment.

Other members of the movie’s cast and crew also are said to have opposed Gibson’s casting, and insiders said high-level execs at the studio also objected.

One studio worker in his 20s suggested that there was a generational divide between older execs and the audience at which the “Hangover” movies are aimed.

“Our generation doesn’t really care about most of what (Gibson) said,” said the worker. “To the people going to the movie, he’s just another wacky celebrity.”

One source close to the script had called Gibson’s casting “genius.” “He’s a mean, crazy guy you’re afraid to ask questions of,” said the source.

While the original movie revolved around a Las Vegas bachelor party that devolves into drunken lost weekend, the follow-up tracks the same quartet on a misbegotten trip to Bangkok.

A source familiar with the production said the character of the tattoo artist is “pivotal” to the plot, in which one of the stars gets a tattoo during a night of debauchery.

The movie began shooting September 30 on the Warners lot, but Gibson’s cameo had yet to be filmed.

On Thursday, Warners, production partner Legendary and Phillips released a joint statement saying that Gibson would not make an appearance in the movie.

“I thought Mel would have been great in the movie, and I had the full backing of (Warner Bros. Pictures Group president) Jeff Robinov and his team,” Phillips said. “But I realize filmmaking is a collaborative effort, and this decision ultimately did not have the full support of my entire cast and crew.”

Beyond the immediate backlash the casting triggered, a number of other considerations came into play.

The first “Hangover” also made use of stunt casting by recruiting Mike Tyson, who played himself in the movie. The former boxer has had plenty of infamous brushes with notoriety, including a 1992 conviction of sexual assault for which he served three years in prison. Tyson also makes an appearance in the “Hangover II” script, though there is no official word whether he will reprise the role.

In the eyes of the studio and filmmakers, though, Tyson’s offenses occurred long enough ago that he is no longer viewed as a controversial figure. His appearance in the first movie, which grossed $467.5 million worldwide, was generally greeted as a comic goof.

Gibson’s own 2006 drunk-driving arrest, in which he unleashed a string of anti-Semitic and sexist remarks, had begun to fade into the past, but the actor was thrust back into the tabloid headlines this summer when angry voicemail messages surfaced in the midst of contentious legal action between Gibson and his former girlfriend Oksana Grigorieva, who also bore him a daughter.

The messages contained racist and sexist language and Grigorieva also launched allegations of domestic abuse.

William Morris Endeavor dropped Gibson as a client. And Summit Entertainment has not yet to decided how to handle the pending release of Gibson’s next movie, “The Beaver,” directed by Jodie Foster.

A final factor may have been the fact that Phillips and Galifianakis are about to plunge into a media push for their movie “Due Date,” which opens November 5. Suddenly, they faced the prospect of answering dozens of questions about why Gibson was going to be appearing in “Hangover II” when they wanted to focus instead on talking about the new movie.