In one case in Phoenix in 2017, the police used a perpetrator’s own cellphone to identify a suspect. Witnesses saw a knife-wielding assailant chase a man into the street and stab him several times. When the attacker fled, he left his cellphone behind; the police sent selfies from the phone to the state Department of Public Safety, whose facial recognition unit produced a potential match.

The suspect in the case, Roberto Santiago-Escobar, pleaded guilty to aggravated assault last year.

But there are no national guidelines for how facial recognition should be used. Several states, including Maryland and Indiana, allow the police to search large databases such as driver’s license photos. But in Oregon, they search only against images collected in criminal proceedings, like mug shots. Private companies may offer to run images against photographs collected from more disparate sources, like social media.

“With regard to driver’s licenses, it is an ethical dilemma because we are searching the faces of citizens who never consented to this type of search in the first place,” said Chris Adzima, senior information systems analyst at the Washington County Sheriff’s Office in Oregon, which has been using facial recognition technology for about two years. “When you take your photo at the D.M.V., it is not considered a public record.”

He said that the sheriff’s office has used it for cases ranging from “murder to shoplifting and in between.”

The technology has been most effective in solving property crimes, like package thefts, pulling images from video doorbells and surveillance cameras, he said.

The police have used facial recognition to identify a suspect already in custody. After the killings of five employees at a newspaper in Annapolis, Md., last June, the police apprehended a suspect at the scene who refused to identify himself. The police used a scan through the Maryland Image Repository System of mug shots and driver’s licenses, which helped reveal his name, Jarrod Ramos.

“We would have been much longer in identifying him and being able to push forward,” Timothy Altomare, chief of the Anne Arundel County Police Department, said at the time.