About 3,000 New York City taxi drivers routinely overcharged riders over two years by surreptitiously fixing their meters to charge rates that would normally apply only to trips outside the five boroughs, according to the city’s Taxi and Limousine Commission.

The drivers’ scheme, the commission said, involved 1.8 million rides and cost passengers an average of $4 to $5 extra per trip. The drivers, officials said, flipped switches on their meters that kicked in the higher rates, costing New York City riders a total of $8.3 million.

The 1.8 million fares represent a tiny fraction of a total 360 million trips over the 26-month period in question.

Agency officials said, however, that they were alarmed enough that they immediately ordered the companies that manufacture the meters to create a system to alert riders when the higher rates are being charged.