Terry Rossio, the screenwriter for "Shrek" and all five "Pirates of the Caribbean" movies, has apologized for controversial tweets he sent out to his followers Friday comparing the "anti-vax" label to the N-word.

In a series of Twitter posts shared Saturday, Rossio offered his mea culpa.

"In a recent Twitter post, arguing against stereotyping and hate speech, I referenced the 'n-word' (the actual word) as an example of what not to do," he wrote. "That was a mistake. I am sorry. I now understand that the word has no place in any conversation, ever.

"You can't make a point against hate speech and reference actual words of hate speech. That was insensitive and ignorant," he continued, adding that he deleted the post "to remove that toxic word from the internet, where it should never appear".

"I continue to stand against hate speech and dehuhmanizing (labels) in any form," he concluded.

Rossio's original tweet was in response to a screenshot shared by TV writer Julie Benson about UNICEF allowing donations for vaccines.

"On UNICEF's site, providing 100 polio vaccines to kids in need is 19 USD. And I'm not saying you should buy it and then send a card to an anti-vax relative saying you've provided lifesaving vaccinations in their name, but actually that's exactly what I'm saying," the screenshot read.

Rossio replied, writing, "My heart goes out to all the parents of vaccine damaged children, who have to not only endure the sadness of their loss, but also the vitriol of ill-informed and insensitive people (such as those here). Anti-Vax is equivalent to calling someone a (expletive) and makes as little sense."

Twitter users were quick to criticize the screenwriter for using the racial slur, including Dictionary.com, who shot down Rossio's idea that the two words were equivalent.

"The n-word is so profoundly offensive that a euphemism has developed for those occasions when the word itself must be discussed," the tweet read. "The same cannot be said for the term 'anti-vax.'"

"The writer of Shrek used the n-word in a tweet comparing the being called anti-vax to being called a racist slur so we absolutely live in the deepest darkest dumbest timeline," one user wrote.

"We are mad at Terry Rossio, screenwriter of Shrek, because he tweeted that using the term 'Anti-Vax' is equivalent to calling someone the N word. He also used the actual N word in said tweet," another tweeted.

"the screenwriter of shrek going absolutely nuts and comparing “anti-vax” to the n-word is precisely what this website was designed for. even in your wildest dreams you could not concoct such absurdity, such wonder," another user wrote.

This isn't the first time a Hollywood figure has been slammed for using the N-word. Earlier this month, actor Viggo Mortensen apologized for using the racial slur during a panel discussion about his new film “Green Book.”

More:Nicolas Roeg, director of 'Don't Look Now' and 'The Man Who Fell to Earth,' dead at 90

More:Diddy shares heartfelt message about late ex-girlfriend Kim Porter on day of her funeral