Technology stocks led a broadly rally for stocks on Wall Street Wednesday that pushed the S&P 500 and Nasdaq indexes to all-time highs for the third straight day.

The latest gains came as investors focused on the latest batch of mostly solid company earnings reports. Meanwhile, health officials raised hopes that the spread of the virus outbreak that originated in China is peaking after new cases dropped for a second straight day.

On Wednesday:

The S&P 500 index rose 21.70 points, or 0.6%, to 3,379.45.

The Dow Jones Industrial Average gained 275.08 points, or 0.9%, to 29,551.42.

The Nasdaq climbed 87.02 points, or 0.9%, to 9,725.96.

The Russell 2000 index of smaller company stocks picked up 11.86 points, or 0.7%, to 1,689.38.

For the week:

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

The Dow is up 448.91 points, or 1.5%.

The Nasdaq is up 205.45 points, or 2.2%.

The Russell 2000 is up 32.60 points, or 2%.

For the year:

The S&P 500 is up 148.67 points, or 4.6%.

The Dow is up 1,012.98 points, or 3.5%.

The Nasdaq is up 753.36 points, or 8.4%.

The Russell 2000 is up 20.91 points, or 1.3%.