NEW YORK — Apple and other big-name technology stocks got back to their winning ways Monday and helped drive U.S. indexes once again to record heights.

The Standard & Poor’s 500 index rose 20.31 points, or 0.8 percent, to 2,453.46 and surpassed its old record, set nearly a week ago, by half a percent. The Dow Jones industrial average added 144.71 points, or 0.7 percent, to 21,528.99, and the Nasdaq composite jumped 87.25, or 1.4 percent, to 6,239.01.

Tech heavyweights, which had been among the stock market’s biggest stars until recently, led the way. After being up more than 20 percent for the year, tech stocks in the S&P 500 fell sharply two Fridays ago on worries that they had risen too much, too quickly. In a little more than a week, tech stocks lost about a fifth of their year-to-date gains.

On Monday, Apple rose for just the second time since two Thursdays ago. It jumped $4.07, or 2.9 percent, to $146.34 for its second-best day of the year so far. Google’s parent, Alphabet, rose $16.60, or 1.7 percent, to $975.22. Altogether, tech stocks in the S&P 500 rose 1.7 percent, the largest gain among the 11 sectors that make up the index.

It is just the latest example of investors steeling themselves and “buying the dip.” Every time the stock market has shown any weakness in the past eight years, it has proved to be a good move for investors to buy.

That is because stocks have ended up erasing any losses incurred, only to move higher. That long track record has trained investors to pounce whenever they see a dip, and analysts have noticed how ingrained the instinct has become.

The biggest gainer in the S&P 500 on Monday was Perkin- Elmer, which sells testing equipment and scientific instruments. It jumped $4.16, or 6.5 percent, to $67.73 after it agreed to buy EUROIMMUN Medical Laboratory Diagnostics of Germany for $1.3 billion in cash.

Bond prices fell, which sent yields higher. The yield on the 10-year Treasury rose to 2.18 percent from 2.15 percent late Friday. The two-year yield climbed to 1.35 percent from 1.31 percent, and the 30-year yield ticked up to 2.79 from 2.77 percent.

Benchmark U.S. crude oil fell 54 cents to settle at $44.43 per barrel. Brent crude, the international standard, fell 46 cents to settle at $46.91 a barrel.

Gold fell $9.80 to settle at $1,246.70 per ounce, silver lost 16 cents to $16.50 per ounce, and copper added 3 cents to $2.59 per pound.