The state attorney general is ordering all New Jersey police to stop using a powerful new facial-recognition technology that’s pulling millions of photos from social media.

The order was issued Friday to county prosecutors, concerning a New York-based company called Clearview AI.

“Like many people, I was troubled,” state Attorney General Gurbir Grewal said about the company’s techniques, which were first reported by The New York Times.

Clearview promotes itself as an effective way to track down dangerous people. It takes partial credit for the recent arrests in New Jersey of 19 men who police say tried to lure children for sex. The company’s main promotional video even featured Grewal and two state troopers at an October press conference about that operation.

Grewal said it was “irresponsible” for the company to reveal investigative techniques, and his office sent Clearview a cease-and-desist letter Friday to stop using that footage.

Tor Ekeland, a Clearview lawyer, wrote in an email that they would take the video down, and it was no longer at the top of the company’s website Friday evening.

Facial-recognition technology has long been used in the state. The Motor Vehicle Commission began using one version almost a decade ago to hunt for fraud, and a state report credited the tool with hundreds of arrests.

But that effort relied on a government database. Clearview uses the “open web,” according to the company, which can mean photos pulled from your public social media accounts. Clearview’s database adds millions of faces every day, according to an internal document.

An unknown number of New Jersey cops have used that database.

Clifton Lt. Robert Bracken said their department used a free trial, but had not purchased it.

“It’s just like any tool, it’s used to develop leads,” he said. “But those leads have to be vetted.”

State Police use a different version of the technology, while Newark has never used any facial recognition, according to a spokesperson.

The company did not respond to questions about how many other agencies have tried it, or how they’re protecting the data.

Grewal said he asked county prosecutors to figure out what agencies have used Clearview.

Regarding the 19 arrests that Clearview took credit for, Grewal said the Bergen County Prosecutor’s office did use a subscription to the service during that investigation. When men sent photos to undercover officers posing as children online, investigators ran those photos in Clearview’s database to identify them, which let them check if the men had criminal histories or owned guns.

That won’t happen again until police know more about how Clearview gets and protects its data, Grewal told NJ Advance Media. He added that he is not “categorically opposed” to the technology in general.

Clearview’s tactics have sparked a backlash. Twitter recently sent the group a cease-and-desist letter, according to a spokesperson, demanding that Clearview “delete all data” and “return or destroy any Twitter material” shared with outsiders.

Facebook and LinkedIn also prohibit groups from “scraping” their information, and spokespeople said they are reviewing Clearview’s actions for possible violations.

While people can ask Clearview to remove their photo, the company notes that requesters need to hold the copyright to the photo. Generally, only the person who takes a photo owns the copyright.

Critics have raised concerns that facial-recognition technology can be abused. Sarah Fajardo, policy director for the ACLU in New Jersey, said the tool can lead to “constant, warrantless searches,” particularly because of the lack of regulation.

In November, U.S. Sen. Cory Booker, D-N.J., introduced a federal bill to ban the technology in public housing.

Blake Nelson can be reached at bnelson@njadvancemedia.com. Follow him on Twitter at @BCunninghamN.

Have a tip? Tell us. nj.com/tips.

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.