Stocks closed broadly higher on Wall Street Tuesday, led by big gains in technology companies. The rally gave the S&P 500 its best gain since early August and drove the tech-heavy Nasdaq to a record high.

Traders were encouraged by a gain in China’s main stock index after the country took more steps to soften the financial blow of the recent virus outbreak. Bond prices fell, sending yields sharply higher.

On Tuesday:

The S&P 500 index rose 48.67 points, or 1.5%, to 3,297.59.

The Dow Jones Industrial Average climbed 407.82 points, or 1.4%, to 28,807.63.

The Nasdaq gained 194.57 points, or 2.1%, to 9,467.97, a record.

The Russell 2000 index of smaller company stocks picked up 24.56 points, or 1.5%, to 1,656.77.

For the week:

The S&P 500 is up 72.07 points, or 2.2%.

The Dow is up 551.60 points, or 2%.

The Nasdaq is up 317.04 points, or 3.5%.

The Russell 2000 is up 42.71 points, or 2.7%.

For the year:

The S&P 500 is up 66.81 points, or 2.1%.

The Dow is up 269.19 points, or 0.9%.

The Nasdaq is up 495.37 points, or 5.5%.

The Russell 2000 is down 11.70 points, or 0.7%.