Despite strong results from industrial companies, U.S. stocks struggled to end in positive territory Tuesday after car makers said their sales are shrinking.

Engine maker Cummins sent manufacturers and other industrial companies higher after reporting solid first-quarter earnings. A late slump took the price of oil to its lowest price in almost six months. Ford, General Motors and Fiat Chrysler all fell after they said sales declined in April.

advertisement | advertise on newsday

Chris Zaccarelli, chief investment officer for Cornerstone Financial Partners, said auto sales have weakened because lenders are growing a bit hesitant to make loans to help people buy cars.

“It’s more a story specific to the auto sector as opposed to a slowdown in consumer spending,” he said.

Thanks to an upturn in the last few minutes of trading, the Standard & Poor’s 500 index rose 2.84 points, or 0.1 percent, to 2,391.17. The Dow Jones industrial average added 36.43 points, or 0.2 percent, to 20,949.89. The Nasdaq composite set another record as it picked up 3.76 points, or 0.1 percent, to 6,095.37. The Russell 2000 index of small-company stocks sank 8 points, or 0.6 percent, to 1,399.36.

The six largest auto makers in the U.S. all said their sales fell in April. Vehicle sales have set records the last few years and analysts are worried the streak is ending.