(Reuters) - PepsiCo pulled a commercial featuring model Kendall Jenner on Wednesday after the ad prompted outrage and ridicule from those who said it trivialized rights protests and public unrest in the United States.

The ad, released late on Tuesday, shows the fashion celebrity and reality TV star in a photo shoot when she sees protesters marching. Removing her wig and makeup, Jenner joins the crowd and hands a baseball cap-wearing police officer a can of Pepsi, prompting him to smile while marchers cheer and hug.

"Pepsi was trying to project a global message of unity, peace and understanding," the company said in a statement. "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."

Pepsi also apologized to Jenner. A representative for Jenner did not return a call for comment.

The spot drew criticism on Twitter, with users saying it belittled the anti-police violence protests over recent years in cities including Ferguson, Missouri, and Baltimore following police killings of unarmed black men and women.

Pepsi said the ad was created by its in-house shop, Creators League Studio. Charlie Hopper, principal and writer at advertising agency Young & Laramore said such backlash is a risk brands take when they lack outside perspective.

"This is a good example of what happens when you don't get the objective input of a classic agency relationship that can say, 'We need to save you from your worst impulses,'" he said.

'THIS AD IS TRASH'

Observers quickly condemned the ad, which did not make clear what the marchers were protesting.

"If I had carried Pepsi, I guess I never would have gotten arrested. Who knew?" activist DeRay McKesson, one of the best-known voices of the Black Lives Matter movement, tweeted. "Pepsi, this ad is trash."

Bernice King, daughter of civil rights leader Martin Luther King Jr., whose assassination occurred 49 years ago on the day Pepsi's ad debuted, tweeted a picture of her father protesting as an officer's hand grips his chest, with the caption: "If only Daddy would have known about the power of #Pepsi."

Many on Twitter criticized the advertisement as a play on today's Black Lives Matter movement, and circulated a 2016 image of Leshia Evans as a point of comparison. Evans, standing passively and wearing a dress, was detained by police in riot gear during a protest in Baton Rouge, Louisiana, not long after the fatal shooting of Alton Sterling by police.

It was not the first time Pepsi has touched a nerve. In 2013, it pulled an online ad for its Mountain Dew beverage amid complaints the spot embraced racial stereotypes and made light of violence toward women. The ad featured a battered white woman on crutches trying to pick out her assailant from a police lineup featuring five African-American men and a goat.

Dr. Boyce Watkins, a social commentator and author, had called that ad "arguably the most racist commercial in history."

Wall Street appeared unfazed by the flap, with PepsiCo trading marginally higher at $112.17.

(The story was refiled to correct paragraph 6 to show Hopper's title is principal and writer, not creative director)