Responding to evidence that its tools had allowed ads to be directed at users who used racist comments or hate speech in their profiles, Facebook said Wednesday that it would change how ads can be targeted.

That its ad-targeting tools could be used in such a way was “a fail” for the company, Sheryl Sandberg, Facebook’s chief operating officer, said in a post. She added that Facebook would add “more human review and oversight” to its automated systems to prevent further misuse.

Ms. Sandberg, who was directly addressing the social network’s recent advertising issues for the first time, also said the company would do more to ensure that offensive content — including that which attacks people for their race or religion — could not be used to target ads.

The announcement came after a report from ProPublica last week revealed that Facebook’s online ad tools had allowed advertisers to target self-described “Jew haters” or people who had used terms like “how to burn Jews.” The terms automatically appeared in Facebook’s ad system because people had apparently filled them in under “education” and “employer” on their profiles.