Five New York car dealerships, including three on Long Island, have agreed to return more than $900,000 in restitution to nearly 6,400 customers after state prosecutors alleged they unlawfully sold credit repair and identity theft protection services to consumers who bought or leased vehicles.

The dealers also agreed to pay $135,000 in penalties to the state, Attorney General Eric T. Schneiderman said in a statement Wednesday.

The Long Island dealerships are Nissan of Garden City, Nissan of Huntington and Volkswagen of Huntington, according to the attorney general’s office.

The other two dealers, Potamkin Hyundai and Potamkin Mitsubishi, are located in Manhattan.

Volkswagen of Huntington and Nissan of Huntington had no comment. Nissan of Garden City didn’t return a call seeking comment. The Manhattan dealerships did not respond to calls for comment.

Schneiderman said the dealerships sold customers “after-sale” credit repair and identity theft protection services that often added thousands of dollars to the purchase price of the vehicle.

“We’ll continue to make sure dealerships are not illegally profiting by charging unsuspecting consumers thousands of dollars on unwanted items,” Schneiderman said in a news release.

advertisement | advertise on newsday

The attorney general’s office said that in some cases, consumers were unaware they had bought the services. In other cases, customers thought the services were free.

In addition to the penalties and costs, the settlements prohibit the dealerships from selling, offering to sell or marketing credit repair and identity theft services in connection with the sale or lease of a vehicle.

These settlements are part of the state’s broader initiative to end the practice engaged in by many dealers of “jamming,” or unlawfully charging consumers without their consent or knowledge for purchases. The state has returned more than $19 million to nearly 29,000 consumers since it started the investigations in 2015.

Consumers who believe they have been jammed with unwanted products or services by a car dealership are urged to call the New York attorney general at 800-771-7755.