Stocks closed mostly lower on Wall Street Monday as the market gave back some of its recent gains following a five-week winning streak.

Declines in banks and industrial stocks offset more gains for technology companies. Even so, the S&P 500 ended August with a 7% gain, the benchmark index’s fifth monthly gain in a row and its biggest since April.

The Nasdaq composite added to its recent string of milestones, closing at an all-time high.

On Monday:

The S&P 500 fell 7.70 points, or 0.2%, to 3,500.31.

The Dow Jones Industrial Average lost 223.82 points, or 0.8%, to 28,430.05.

The Nasdaq rose 79.82 points, or 0.7%, to 11,775.46.

The Russell 2000 index of small company stocks fell 16.47 points, or 1%, to 1,561.88.

For the year:

The S&P 500 is up 269.53 points, or 8.3%.

The Dow is down 108.39 points, or 0.4%.

The Nasdaq is up 2,802.85 points, or 31.2%.

The Russell 2000 is down 106.59 points, or 6.4%.