Stocks closed out a rocky second quarter on Wall Street Friday with solid gains as banks led indexes higher.

Shares in financial sector companies climbed after the Federal Reserve gave the country’s 18 biggest banks permission to pay more dividends and buy back more of their own stock. The rally came as investors looking ahead to this weekend’s scheduled trade meeting between U.S. President Donald Trump and Chinese leader Xi Jinping.

On Friday:

The S&P 500 index rose 16.84 points, or 0.6%, to 2,941.76.

The Dow Jones Industrial Average gained 73.38 points, or 0.3%, to 26,599.96.

The Nasdaq composite added 38.49 points, or 0.5%, to 8,006.24.

The Russell 2000 index of smaller company stocks climbed 20.02 points, or 1.3%, to 1,566.57.

For the week:

The S&P 500 fell 8.70 points, or 0.3%.

The Dow dropped 119.17 points, or 0.4%.

The Nasdaq lost 25.46 points, or 0.3%.

The Russell 2000 gained 16.94 points, or 1.1%.

For the year:

The S&P 500 is up 434.91 points, or 17.3%.

The Dow is up 3,272.50 points, or 14%.

The Nasdaq is up 1,370.97 points, or 20.7%.

The Russell 2000 is up 218.01 points, or 16.2%.