When a children’s jewelry maker began advertising on Instagram, she promoted photos of a 5-year-old girl wearing a sparkly charm to users interested in parenting, children, ballet and other topics identified by Meta as appealing mostly to women.

But when the merchant got the automated results of her ad campaign from Instagram, the opposite had happened: The ads had gone almost entirely to adult men.

Perplexed and concerned, the merchant contacted The New York Times, which in recent years has published multiple articles about the abuse of children on social media platforms. In February, The Times investigated Instagram accounts run by parents for their young daughters, and the dark underworld of men who have sexualized interactions with those accounts.

With the photos from the jewelry ads in hand, The Times set out to understand why they attracted an unwanted audience. Test ads run by The Times using the same photos with no text not only replicated the merchant’s experience — they drew the attention of convicted sex offenders and other men whose accounts indicated a sexual interest in children or who wrote sexual messages.

The Times opened two Instagram accounts and promoted posts showing the 5-year-old girl, her face turned away from the camera, wearing a tank top and the charm. Separate posts showed the clothing and jewelry without the child model, or with a black box concealing her. All of the paid ads were promoted to people interested in topics like childhood, dance and cheerleading, which Meta’s audience tools estimated as predominantly women.