Twentieth Century Fox fired YouTube star and actor Kian Lawley from its upcoming film The Hate U Give on Tuesday after a video surfaced in which he can be heard using the N-word and making racially-charged remarks.

The video — posted to Lawley’s YouTube account on January 26 but possibly recorded before then — is titled “Kian Lawley being Racist.”

“We’re all black drinking purple Kool-aid and eating Kentucky fried mother f*cking chicken,” the 22-year-old H8ers star says in the brief video.

Lawley had apparently already shot at least some scenes for the film, according to a statement from the studio.

[Explicit Language]

https://www.youtube.com/watch?v=4oFb8YWVnuE&feature=youtu.be

The Hate U Give is based on the 2017 young adult novel of the same name by Angie Thomas, which reportedly tells the Black Lives Matter-inspired story of a young woman who becomes more involved in activism after witnessing the police shooting of a friend.

“Due to the controversy surrounding his past comments and behavior, Kian Lawley will no longer appear in The Hate U Give,” a spokesperson for Twentieth Century Fox Film said in the statement. “The studio plans to recast the role of Chris and reshoot scenes as needed.”

Lawley issued an apology in his own statement Tuesday.

“Words have power and can do damage. I own mine and I am sorry,” he said. “I respect Fox’s decision to recast this role for The Hate U Give as it is an important story, and it would not be appropriate for me to be involved considering the actions of my past. I understand the impact and I have grown and learned since then. From now on I plan to use my voice for positive change.”

The actor also appeared to reference the incident in a post to his Twitter account Sunday.

if u don’t learn from ur mistakes, u can never grow as a person. i’ve learned a lot & i am grateful to have the power to change. i never want to be who i was yesterday. we’re in a constant battle to become a better version of ourselves, use ur voice as ur weapon. — Kian Lawley (@KianLawley) February 4, 2018

Lawley is the latest YouTube star to come under fire for the content in his videos.

Last month, popular vlogger and YouTube personality Logan Paul issued a public apology after broadcasting video footage of a man who had committed suicide by hanging in a Japanese forest. Paul was later suspended from YouTube for the incident.

The Lawley decision also marks the second time in recent months that a major studio has chosen to replace an actor accused of misconduct after production had already started.

In November, Sony and director Ridley Scott announced that actor Christopher Plummer would replace Kevin Spacey in the J. Paul Getty drama All the Money in the World, after the latter actor was accused of repeated sexual misconduct.

Follow Daniel Nussbaum on Twitter: @dznussbaum