A late wave of buying left major U.S. stock indexes with modest gains on Wall Street Thursday after spending most of the day in the red.

Technology companies and banks did the best. Investors were assessing the latest company earnings reports and developments in the outbreak of a new virus in China.

On Thursday:

The S&P 500 rose 10.26 points, or 0.3%, to 3,283.66.

The Dow Jones Industrial Average climbed 124.99 points, or 0.4%, to 28,859.44.

The Nasdaq added 23.77 points, or 0.3%, to 9,298.93.

The Russell 2000 index of smaller companies slipped 1 point, or 0.1%, to 1,648.22.

For the week:

The S&P 500 is down 11.81 points, or 0.4%.

The Dow is down 130.29 points, or 0.4%.

The Nasdaq is down 15.98 points, or 0.2%.

The Russell 2000 is down 14.01 points, or 0.8%.

For the year:

The S&P 500 is up 52.88 points, or 1.6%.

The Dow is up 321 points, or 1.1%.

The Nasdaq is up 326.33 points, or 3.6%.

The Russell 2000 is down 20.25 points, or 1.2%.