Energy companies led U.S. stocks broadly higher Tuesday, as the market bounced back from its worst loss in months.

The majority of big stocks in the S&P 500 notched gains, with oil producers leading the way as crude prices strengthened. Stocks of smaller companies did even better than the broader market, driving the Russell 2000 index of small-caps to a market-leading 1.7% gain. Treasury yields rose.

On Tuesday:

The S&P 500 rose 26.21 points, or 0.7%, to 3,726.86.

The Dow Jones Industrial Average gained 167.71 points, or 0.6%, to 30,391.60.

The Nasdaq composite picked up 120.51 points, or 1%, to 12,818.96.

The Russell 2000 index of smaller companies climbed 33.19 points, or 1.7%, to 1,979.11.

For the week:

The S&P 500 is down 29.21 points, or 0.8%.

The Dow is down 214.88 points, or 0.7%.

The Nasdaq is down 69.32 points, or 0.5%.

The Russell 2000 is up 4.25 points, or 0.2%.