YouTube star Kian Lawley has been dropped from a forthcoming 20th Century Fox film The Hate U Give after a video surfaced of him making racist remarks.

The internet sensation, who has well over three million subscribers to his YouTube channel, can be heard using the N-word and other racial slurs in the recently unearthed clip.

“We’re all black drinking purple Kool-aid and eating Kentucky fried mother***ing chicken,” Lawley says in the undated video.

The clip, which was uploaded late last month by YouTube user Just Trash, gained more than 42,000 views but now appears to have been taken down.

“This video is no longer available due to a copyright claim by Jc Caylen,” reads a message on the page.

Lawley, who has not specified when the video was filmed, apologised on Sunday on Twitter.

The 22-year-old said: “If you don’t learn from your mistakes, you can never grow as a person. I’ve learned a lot and 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 your voice as your weapon.”

11 YouTube features you didn't know existed Show all 11 1 /11 11 YouTube features you didn't know existed 11 YouTube features you didn't know existed Play in the background One of the YouTube app’s most frustrating shortcomings is the inability to play music videos in the background or when you’re phone’s locked. There is a way around this, but only on iOS. Open the YouTube website in Safari, play a video and then press your iPhone’s home button. After that, launch the Control Centre by sliding up from the bottom of the screen and tap play. 11 YouTube features you didn't know existed Loop videos YouTube’s looping option on desktop is really useful, but nowhere near as easy to find as it should be. To loop a video, right-click it while it’s playing and select Loop. Even if you have Autoplay enabled, your video will replay itself as soon as it finishes. 11 YouTube features you didn't know existed Enable Dark Theme YouTube recently introduced a black-and-red Dark Theme on the desktop, which is much easier on your eyes than the regular version of the site. Enable it by clicking the account symbol, selecting Dark Theme and turning Activate Dark Theme on. 11 YouTube features you didn't know existed Simplify YouTube Another alternative YouTube user interface is available to access at youtube.com/tv. It’s a really simple, no-frills UI that’s incredibly easy to navigate. 11 YouTube features you didn't know existed Try out new features You can test upcoming and experimental features early by signing up to YouTube TestTube. 11 YouTube features you didn't know existed Read When you want to watch a YouTube video but don’t have your headphones and don’t want to disturb anyone around you, turn on Captions. They’re also really handy if you’re trying to watch a video in a foreign language. Transcriptions, meanwhile, break down exactly when certain things take place, so you can skip to the part you want to watch accurately and easily. In the More tab under the video title, launch the dropdown menu and select Transcript. 11 YouTube features you didn't know existed Use shortcuts You can lean back in your seat and control YouTube videos with your keyboard if you want to. J and L let you rewind and fast-forward 10 seconds, K is pause/play, M is mute/unmute and the 0-9 keys let you jump through various stages of the video, from 0 per cent to 90 per cent. On the app, you can fast forward or rewind 10 seconds by double-tapping the right or left side of a video. 11 YouTube features you didn't know existed Limit data use If you’re on a limited mobile data plan, there are easy ways to save yourself some money. In Settings on the YouTube app, hit General and enable Limit Mobile Data Usage and disable Autoplay. 11 YouTube features you didn't know existed Keep things private Unless you make them private, other people can see your Liked videos, your saved playlists and subscriptions. If you want to hide them, go to Settings and Privacy. You can also clear or pause your History. On either desktop or the mobile app, go to History and select Clear All Watch History or Pause Watch History. 11 YouTube features you didn't know existed Make sharing clearer Sometimes you want to share a video with a friend, but want them to watch a specific part, rather than the whole thing. Instead of sending the timestamp through as a separate message, make the video automatically play from the right place. Just pause it at the right moment, click the Share button, tick the Start At box and copy the URL. 11 YouTube features you didn't know existed Get nerdy Stats for Nerds shows you technical data for YouTube videos, including video format, audio format and bandwidth. On desktop, you can find the info simply by right-clicking the video player and selecting Stats for Nerds. On mobile, you have to enable it first in General Settings. Once that’s done, open a video, hit the menu button in the top-right corner and tap the Stats for Nerds option.

He continued: "First of all, I am deeply sorry to those that were effected by my choice of language. I understand that I am in the public eye and have many supporters, but none of my actions that took place should be supported. Words have power and can do a lot damage. I own mine and I am sorry.”

Lawley, who also co-stars in Fullscreen series H8TERS alongside fellow YouTuber and friend Jc Caylen, said he respected Fox’s decision to drop him from the film.

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 a lot and learned since then.”

A spokesperson for Twentieth Century Fox Films told CNN: “Due to the controversy surrounding his past comments and behaviour, Kian Lawley will no longer appear in The Hate U Give. The studio plans to recast the role of Chris and reshoot scenes as needed.”

Lawley had been lined up to play the boyfriend of the film’s protagonist Starr Cater who is played by Amandla Stenberg – the 19-year-old star of Hunger Games who has spoken out about race and cultural appropriation.

The film is based on Angela Thomas’ young adult novel which takes the same name and explores themes of race and police brutality.

Stenberg plays a teenager growing up in an impoverished, predominantly black neighbour who attends an affluent prep school where she is surrounded by mostly white students. She is thrown into even greater internal conflict after bearing witness to police firing at her unarmed childhood friend. The tale is inspired by the Black Lives Matter movement.

Issa Rae, Regina Hall, Russell Hornsby, Algee Smith, Lamar Johnson, and Common are some of the other cast members. The film has yet to be given a release date but filming finished in November.

Lawley is the most recent YouTube star to get themselves into trouble with their creative partners after racial and culturally insensitive remarks surfaced on the internet.

Fellow YouTuber Logan Paul faced fierce criticism for posting a video last month that featured images of a suicide victim.

The video, which has now been taken down, was shot in Aokigahara - a Japanese woodland also known as the “suicide forest”.