BOSTON — The Massachusetts attorney general has sued a car dealership that allegedly sold lemons to hundreds of customers under predatory loan terms.

The suit filed Tuesday against J.D. Byrider alleges the dealer sold defective and sometimes inoperable vehicles with high cost loans at four Massachusetts locations —Boston, Brockton, Dartmouth and Springfield.

The attorney general says hundreds of customers have returned vehicles to J.D. Byrider for repair within three months of purchase due to problems with the engine, electrical system, transmission, brakes, or drive train.

The complaint alleges more than half of J.D. Byrider’s deals fail or end in repossession, causing long-term economic harm to consumers.

The company said it is “looking into the facts of this matter carefully” and is “committed to working with regulators to solve concerns and improve our business.”