A dozen licensed taxi drivers have been arrested after using in-car credit card scanners to steal nearly $40,000 in phony fares from cardholders, the city’s Department of Investigation announced Thursday.

The cab drivers used stolen credit card information to ring up fake trips that sometimes lasted less than a minute but came with fares that ranged between $100 and $499, the agency said. The activity allegedly took place over a seven month period, between January and July of 2015.

“These taxi drivers turned their cabs into a crime scene,” said Mark G. Peters, DOI commissioner, in a statement. “They exploited their taxis’ electronic payment systems to run up thousands of dollars in fake charges for fake rides, according to the charges.”

Peters’ department launched an investigation into the drivers after city vendors responsible for electronic payments in taxis, Verifone and Creative Mobile Technologies, noticed the unusual trips and alerted the department.

In almost every charge discovered, the cardholders were found to have either not been in New York City or not to have taken a taxi cab during the days on which the transactions took place.

The majority of the defendants allegedly turned their cab meters to Rate 5, which represents a negotiated fare outside the five boroughs. They then put the stolen credit card information through the electronic payment system to pay for fictitious trips that mostly lasted less than a minute, according to the department. Some didn’t include destinations at all.

It was not immediately clear how the drivers obtained the credit card information. The Department of Investigation declined to comment further, citing an ongoing investigation.

The drivers have been charged with varying degrees of felony grand larceny and criminal possession of stolen property. Each driver’s TLC license was suspended upon arrest. If convicted, TLC will revoke the licenses.

The TLC deferred comment to the Department of Investigation.

A 13th arrest was made of a brother of a licensed cab driver charged with posing as his sibling, the department said.