Pepsi has apologized for a controversial advertisement that borrowed imagery from the Black Lives Matter movement, after a day of intense criticism from people who said it trivialized the widespread protests against the killings of black people by the police.

“Pepsi was trying to project a global message of unity, peace and understanding. Clearly, we missed the mark and apologize,” the company said in a statement on Wednesday. “We did not intend to make light of any serious issue. We are pulling the content and halting any further rollout.”

The ad, posted to YouTube on Tuesday, shows attractive young people holding milquetoast signs with nonspecific pleas like “Join the conversation.” The protesters are uniformly smiling, laughing, clapping, hugging and high-fiving.

In the ad’s climactic scene, a police officer accepts a can of Pepsi from Kendall Jenner, a white woman, setting off raucous approval from the protesters and an appreciative grin from the officer.

It was, current activists say, precisely the opposite of their real-world experience of protesting police brutality.

In torrid criticism after the ad was posted, commentators on social media accused Pepsi of appropriating imagery from serious protests to sell its product, while minimizing the danger protesters encounter and the frustration they feel.

Elle Hearns, the executive director of the Marsha P. Johnson Institute and formerly an organizer for Black Lives Matter, said the ad “plays down the sacrifices people have historically taken in utilizing protests.”

“No one is finding joy from Pepsi at a protest,” she said. “That’s just not the reality of our lives. That’s not what it looks like to take bold action.”

In a statement on Tuesday, Pepsi at first said the ad, which was produced by an in-house studio, “captures the spirit and actions of those people that jump in to every moment.”

To many who saw the ad, it was a tone-deaf note. Bernice King, the daughter of Martin Luther King Jr. and Coretta Scott King, was among those who drew the connection to past protests.