Cheaper gas might end up costing drivers in the long run, according to AAA.

The automotive group found significant differences in the quality of gasoline sold at fuel retailers in recent testing.

The off-brand gasolines can cause "19 times more engine deposits" than recognizable brands, which have more detergent in their mix. The problem can occur after just 4,000 miles of simulated driving.

"Such carbon deposits are known to reduce fuel economy, increase emissions and negatively impact vehicle performance, particularly on newer vehicles," said AAA.

The "top tier" brands with more detergent additives are much better for the car and mileage.

The list of top tier gasoline brands that passed AAA's test includes the nation's major consumer brands: Exxon Mobil (XOM), Conoco (COP), BP (BP), Shell (RDSA), Chevron (CVX), Citgo, Phillips 66 (PSX) and Valero (VLO).

Related: Cheap gas blamed for highest number of traffic deaths since 2008

"AAA was surprised to learn the extent to which detergent additives impact gasoline quality," said John Nielsen, AAA's managing director of automotive engineering and repair. He said the top brands "kept engines remarkably cleaner than other fuels we tested."