Stocks closed broadly higher Friday, snapping two consecutive weekly declines for the market.

The market had already sold off in recent weeks ahead of Friday's expected ratcheting up of trade tensions between the U.S. and China, which launched dueling tariffs on billions of goods. Investors were also encouraged by a solid pickup in hiring by U.S. employers last month.

On Friday:

The S&P 500 index rose 23.21 points, or 0.8 percent, to 2,759.82.

The Dow Jones Industrial Average gained 99.74 points, or 0.4 percent, to 24,456.48.

The Nasdaq composite added 101.96 points, or 1.3 percent, to 7,688.39.

The Russell 2000 index of smaller-company stocks picked up 14.57 points, or 0.9 percent, to 1,694.05.

For the week:

The S&P 500 rose 41.45 points, or 1.5 percent.

The Dow added 185.07 points, or 0.8 percent.

The Nasdaq gained 178.08 points, or 2.4 percent.

The Russell 2000 picked up 50.99 points, or 3.1 percent.

For the year:

The S&P 500 is up 86.21 points, or 3.2 percent.

The Dow is down 262.74 points, or 1.1 percent.

The Nasdaq is up 785 points, or 11.4 percent.

The Russell 2000 is up 158.54 points, or 10.3 percent.