More than 500 people were arrested in a national sex-trafficking sting that used an artificial intelligence chat bot to interact with potential sex buyers.

In Cook County, 45 sex buyers were arrested in the so-called “National Johns Suppression Initiative,” which was conducted in 11 states by 26 law enforcement agencies, according to the Cook County sheriff’s office.

Agencies in six cities used fake internet ads that linked to AI bots that interacted with thousands of “johns” — or sex buyers — the sheriff’s office said. The agencies also used street-level reverse stings and online stings with police-posted decoy ads on multiple trafficking-related websites.

The operation ran from June 23 to July 28, and led to 503 arrests, including eight who were charged with soliciting a minor and 18 charged with trafficking, according to the sheriff’s office. Thirty-four people, including three minors, were recovered and offered services. More than half of the arrests were related to internet ads.

The AI bot, created by childsafe.ai, interacts with potential sex buyers and eventually sends a deterrence message warning of the legal and social effects of buying sex, the sheriff’s office said. The bot contacted over 1,100 people in Cook County alone.

The Cook County Sheriff Thomas Dart started the “National John” initiative in 2011 to draw attention to the role sex buyers play in fueling sex trafficking, the sheriff’s office said. Since then, the initiative has involved more than 140 agencies and led to the arrests of 9,500 sex buyers.

Read more on crime, and track the city’s homicides.