The Los Angeles Police Department was trying to figure out Saturday how one of its ads for new recruits ended up on right-wing news site Breitbart.

The department, in which Latinos comprise the largest ethnic group of officers, was quick to denounce the placement on a platform that has often highlighted the misdeeds and crimes of people living in the U.S. without proper documentation and that critics have accused of posting racist content.

LAPD Chief Michel Moore tweeted Saturday that his department would team up with the city's Personnel Department to determine how the ad, featuring a photo of an officer and the words, "Choose Your Future," ended up on the website once run by Stephen Bannon, a former adviser to President Donald Trump.

Uhhhh why is the LAPD running recruitment ads on Breitbart?! pic.twitter.com/9gr1hnmy4o — Noah Shachtman (@NoahShachtman) September 28, 2019

The ad placement story went viral after Noah Shachtman, editor-in-chief of the Daily Beast, tweeted about it Friday night.

The department's Media Relations Division responded Saturday on Twitter.

"The LAPD celebrates diversity and embraces it within our ranks, and within the city we serve," it said. "We are aware that a recruitment advertisement has been circulated on a website that creates a negative juxtaposition to our core values."

How the advertisement ended up on Breitbart was not much of a mystery to media experts, who noted that online ad buys, particularly those made through Google, target demographics rather than publications and can even follow targeted readers from site to site.

Some experts have say that sites like Breitbart can be omitted from such buys, but that advertisers have to proactively discriminate.

By Saturday afternoon, the LAPD's recruitment account on Twitter said it was a Google ad buy that placed the recruitment graphic on Breitbart.

"The Personnel Department has not made any purchase of LAPD recruitment ads on Breitbart or similar sites," it said. "Recruitment ads were purchased through Google and ended up on sites that do not reflect the City's values through automatic placement."

"We have stopped these Google Ads altogether while we reexamine our ad filters and take all necessary steps to ensure tighter control of ad settings," the department said.

Breitbart spokeswoman Elizabeth Moore said in a statement to the Los Angeles Times that Breitbart has "one of the most pro-police, pro-law-enforcement news organizations in America."