Stocks faded in the last hour of trading and ended mostly lower Wednesday, a day after the S&P 500 and the Dow Jones Industrial Average set their latest record highs.

The S&P 500 and the Dow Jones Industrial Average fell. The Nasdaq ended little changed. Several big technology companies posted solid gains, led by Microsoft, which reported a surge in profits last quarter as its cloud computing business bounded ahead.

On Wednesday:

The S&P 500 fell 23.11 points, or 0.5%, to 4,551.68.

The Dow Jones Industrial Average fell 266.19 points, or 0.7%, to 35,490.69.

The Nasdaq rose 0.12 points, or less than 0.1%, to 15,235.84.

The Russell 2000 index of smaller companies fell 43.58 points, or 1.9%, to 2,252.49.

For the week:

The S&P 500 is up 6.78 points, or 0.1%.

The Dow is down 186.33 points, or 0.5%.

The Nasdaq is up 145.64 points, or 1%.

The Russell 2000 is down 38.78 points, or 1.7%

For the year:

The S&P 500 is up 795.61 points, or 21.2%.

The Dow is up 4,884.21 points, or 16%.

The Nasdaq is up 2,347.56 points, or 18.2%.

The Russell 2000 is up 277.64 points, or 14.1%.