Alphabet and Microsoft led the U.S. stock market to its first winning week in the last four and its biggest weekly gain since November.

The S&P 500 rose 1% Friday. The Dow Jones Industrial Average added 0.4%, and the Nasdaq composite gained 2%.

Google’s parent company jumped after breezing past analysts’ expectations for profit and announcing its first dividend. Microsoft climbed after also topping forecasts. They helped offset a slide for Intel after it gave a forecast for profit that fell short of analysts’ expectations. Treasury yields eased after a report on inflation for March came in close to expectations.

On Friday:

The S&P 500 rose 51.54 points, or 1%, to 5,099.96.

The Dow Jones Industrial Average rose 153.86 points, or 0.4%, to 38,239.66.

The Nasdaq composite rose 316.14 points, or 2%, to 15,927.90.

The Russell 2000 index of smaller companies rose 20.88 points, or 1.1%, to 2,002.

For the week:

The S&P 500 is up 132.73 points, or 2.7%.

The Dow is up 253.26 points, or 0.7%.

The Nasdaq is up 645.89 points, or 4.2%.

The Russell 2000 is up 54.34 points, or 2.8%.

For the year:

The S&P 500 is up 330.13 points, or 6.9%.

The Dow is up 550.12 points, or 1.5%.

The Nasdaq is up 916.55 points, or 6.1%.

The Russell 2000 is down 25.07 points, or 1.2%.