The description below the ad on Pepsi's Global YouTube channel states: "A short film about the moments when we decide to let go, choose to act, follow our passion and nothing holds us back."

In the ad, Jenner is seen posing in a blond wig at a photo shoot, while a peace protest marches by. She then ditches the wig, grabs a can of Pepsi and joins the protest. Jenner gets to the front and hands the can to a police officer, who drinks as the crowd cheers.

An advertisement for Pepsi featuring model Kendall Jenner handing a can of soda to a police officer at a peace protest has sparked a backlash online, sparking the company to yank the ad.

The ad was an attempt to reach out to millennials, but following intense social media criticism, a Pepsi spokesperson said in a press release that it was pulling the ad.

"Pepsi was trying to project a global message of unity, peace and understanding," the release said. "Clearly we missed the mark, and we apologize. We did not intend to make light of any serious issue. We are removing the content and halting any further rollout."

People took to Twitter to comment, with comedian Travon Free saying: "The Kendall Jenner Pepsi fiasco is a perfect example of what happens when there's no black people in the room when decisions are being made." It was retweeted more than 4,800 times.

TWEET

Another tweeter wrote: "Can't believe Kendall Jenner just solved institutionalized racism and oppression by giving a cop a Pepsi. Groundbreaking."

TWEET

The ad has also been compared with the image of Ieshia Evans who was arrested by police at a protest in Baton Rouge, Louisiana, in 2016. Taryn Finley wrote: "Could you be any more blatant with the disrespect and appropriation of a movement, @Pepsi? Is this a sick joke?!"

TWEET

A Pepsi spokesperson said in an emailed statement: "This is a global ad that reflects people from different walks of life coming together in a spirit of harmony, and we think that's an important message to convey."

Follow CNBC International on Twitter and Facebook.