When the suspect in the mass shooting at the Capital Gazette in Annapolis was taken into custody Tuesday, he had no identification and said little, so police turned to a sophisticated facial-recognition system, officials said.

Police fed the man’s photo into the Maryland Image Repository System (MIRS), which matched it against tens of millions of photos from state driver’s licenses, offender photos and an FBI mug shot database.

It apparently returned a hit: Jarrod Ramos.

The case is the most high-profile use to date of MIRS, a cutting-edge and controversial tool that has been used by the Maryland State Police and other law enforcement agencies across the state since it launched in 2011.

John Cusumano described his neighbor, who opened fire at the staff of the Capital Gazette in Annapolis June 28, as "quiet." (Joyce Koh/The Washington Post)

“The facial recognition system performed as designed,” said Stephen T. Moyer, secretary of Maryland’s Department of Public Safety and Correctional Services (DPSCS), in a statement. “It has been and continues to be a valuable tool for fighting crime in our state.”

The system uses algorithms to compare a suspect’s distinctive facial features against at least 7 million Maryland driver’s license photos, 3 million state offender images and nearly 25 million FBI mug shots, according to a 2016 report by the Georgetown Law Center on Privacy and Technology. DPSCS did not respond to a request for updated figures.

MIRS initially drew little attention, but became a focus for privacy and civil liberties advocates after documents obtained by the American Civil Liberties Union revealed that it was used to identify protesters in Baltimore after the death of Freddie Gray in 2015.

“Maryland’s use is on the more aggressive end for how we see the use of this technology,” said Clare Garvie, an associate at the Georgetown center.

But it is hardly alone. Garvie said 31 states permit the FBI to search their driver’s license photos for facial matches.

“Over 50 percent of all adult Americans are in biometric databases that are accessible for criminal investigations,” Garvie added.

A 2017 audit said Maryland did not track how often the system was used but noted that it costs about $185,000 a year to maintain. The Georgetown Law report said it was unclear whether Maryland’s Department of Public Safety and Correctional Services scrubs the database to eliminate people who were never charged, had charges dropped or dismissed, or were found innocent.

Officials acknowledge in materials about the system that it can misidentify individuals.

Civil liberties advocates are particularly concerned about the impact on minorities, given that research has shown some facial-recognition software has a harder time identifying the faces of African Americans. They are also concerned that the system might eventually be used in conjunction with surveillance cameras to provide real-time scanning of streets.

The use of facial-recognition software by law enforcement has been a hot topic in recent months. In May, a coalition of groups called on Amazon.com to stop selling low-cost facial-recognition software called Rekognition to police because of concerns about surveillance of vulnerable communities. (Amazon founder and CEO Jeffrey P. Bezos owns The Washington Post.)

“People should be free to walk down the street without being watched by the government,” the ACLU wrote in a blog item. “By automating mass surveillance, facial recognition systems like Rekognition threaten this freedom, posing a particular threat to communities already unjustly targeted in the current political climate.”