SAN DIEGO — Facial recognition software, which American military and intelligence agencies used for years in Iraq and Afghanistan to identify potential terrorists, is being eagerly adopted by dozens of police departments around the country to pursue drug dealers, prostitutes and other conventional criminal suspects. But because it is being used with few guidelines and with little oversight or public disclosure, it is raising questions of privacy and concerns about potential misuse.

Law enforcement officers say the technology is much faster than fingerprinting at identifying suspects, although it is unclear how much it is helping the police make arrests.

When Aaron Harvey was stopped by the police here in 2013 while driving near his grandmother’s house, an officer not only searched his car, he said, but also took his photograph and ran it through the software to try to confirm his identity and determine whether he had a criminal record.

Eric Hanson, a retired firefighter, had a similar experience last summer. Stopped by the police after a dispute with a man he said was a prowler, he was ordered to sit on a curb, he said, while officers took his photo with an iPad and ran it through the same facial recognition software. The officers also used a cotton swab to collect a DNA sample from the inside of his cheek.