Struggling Ford racked up four “best in show” awards, the most of any major automaker, in an influential vehicle-quality survey released Wednesday.

The Ford Mustang took top honors in the midsize sports-car category of J.D. Power & Associates’ annual survey of new-vehicle quality.

The MKX from the company’s Lincoln luxury brand was top among entry-level premium cars, and Lincoln’s Mark LT finished first among large sport-utility vehicles. Another Ford product, the Mercury Milan, scored first in the midsize car category.

Ford led all automakers with 12 vehicles placing among the top three finishers in the 19 categories in the J.D. Power survey. It also moved up to third place among non-luxury nameplates in terms of fewest defects per 100 new vehicles, up from eighth place last year.

The results “contain some encouraging and positive news for Ford,” said Neal Oddes, director of product research and analysis at Westlake Village, Calif.-based J.D. Power. Ford is carrying out a major restructuring as it works to return to profitability.

Honda placed first among non-luxury brands for fewest defects, and its popular Civic captured top honors in the important compact-car category.

Rival Japanese automaker Toyota, which has been plagued by a series of embarrassing recalls recently, fell behind Honda in the quality rankings as its defects-per-vehicle rating rose to 112 from 106.

For the second straight year, Porsche finished first among all automakers for fewest defects. Fellow German nameplate Mercedes-Benz, which fared poorly in a Consumer Reports quality survey this year, mounted a strong comeback in the J.D. Power report, moving up 20 places in the overall quality rankings — the biggest gain of any brand.