Stocks closed higher on Wall Street Tuesday, recovering some of last week’s losses and pulling closer to their record highs.

Technology, communication services and health care stocks accounted for much of the rally, though energy sector companies notched the biggest gain. Household goods makers, real estate and utilities were the only laggards.

Markets have been rising on enthusiasm about a coming economic recovery as COVID-19 vaccines roll out and expectations that Washington will soon try to deliver another round of economic stimulus.

On Tuesday:

The S&P 500 rose 30.66 points, or 0.8%, to 3,798.91.

The Dow Jones Industrial Average added 116.26 points, or 0.4%, to 30,930.52.

The Nasdaq composite gained 198.68 points, or 1.5%, to 13,197.18.

The Russell 2000 index of smaller companies picked up 27.94 points, or 1.3%, to 2,151.14.

For the year:

The S&P 500 is up 42.84 points, or 1.1%.

The Dow is up 324.04 points, or 1.1%.

The Nasdaq is up 308.90 points, or 2.4%.

The Russell 2000 is up 176.28 points, or 8.9%.