U.S. stocks careened between big gains and losses on Tuesday before indexes ended the day mixed, the latest dizzying run for a market that's been dominated by them in recent months.

A morning burst driven by hopes for U.S.-China trade talks gave way to losses triggered by falling bank stocks and the threat of a federal government shutdown.

On Tuesday:

The S&P 500 index dipped by 0.94 points, or less than 0.1 percent, to 2,636.78.

The Dow Jones Industrial Average fell 53.02, or 0.2 percent, to 24,370.24.

The Nasdaq composite rose 11.31, or 0.2 percent, to 7,031.83.

The Russell 2000 index of smaller-company stocks lost 2.96, or 0.2 percent, to 1,440.13.

For the week:

The S&P 500 is up 3.70 points, or 0.1 percent.

The Dow is down 18.71 points, or 0.1 percent.

The Nasdaq is up 62.58 points, or 0.9 percent.

The Russell 2000 is down 7.95 points, or 0.5 percent.

For the year:

The S&P 500 is down 36.83 points, or 1.4 percent.

The Dow is down 348.98 points, or 1.4 percent.

The Nasdaq is up 128.44 points, or 1.9 percent.

The Russell 2000 is down 95.38 points, or 6.2 percent.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.