NEW YORK — Some of the biggest companies in the world had their best day in years Friday as Microsoft and Alphabet soared following strong third-quarter reports, as did online retail giant Amazon. U.S. stocks set more records as their winning streak extended to a seventh week.

Intel made its biggest gains in three years, while Microsoft had its biggest jump in two years and Alphabet, Google’s parent company, made its largest move in more than a year after each company’s results were better than Wall Street expected. Amazon jumped 13 percent, its biggest move in two and a half years, after it got a big boost from its latest “Prime Day” promotion and the purchase of the Whole Foods grocery store chain.

“The transition to cloud computing really played a role in all of those tech results to some extent,” said Brad Sorensen, the director of market and sector analysis for the Schwab Center for Financial Research. Technology companies get a lot of their profits outside the U.S. compared to other industries, so the improving global economy is helping them more.

The Standard & Poor’s 500 index rose 20.67 points, or 0.8 percent, to 2,581.07. The Dow Jones industrial average made a comparatively modest gain of 33.33 points, or 0.1 percent, to 23,434.19 as drugmaker Merck and oil company Chevron skidded after their third-quarter reports. The Nasdaq composite made its biggest gain since November as it soared 144.49 points, or 2.2 percent, to 6,701.26. The Russell 2000 index of smaller-company stocks picked up 10.86 points, or 0.7 percent, to 1,508.32.

The S&P 500 and Nasdaq finished at all-time highs. The S&P 500 also rose for the seventh consecutive week, something that hadn’t happened since late 2014.

Alphabet climbed $42.25, or 4.3 percent, to $1,033.67 and Microsoft soared $5.05, or 6.4 percent, to $83.81. Intel, the world’s biggest chipmaker, jumped $3.05, or 7.4 percent, to $44.40 after a positive fourth-quarter estimate.

Amazon posted strong results and gave an optimistic outlook for the holiday season. Its stock jumped $128.52, or 13.2 percent, to $1,100.95.