U.S. stocks moved broadly higher in early trading Wednesday, recovering some of their losses from a steep drop ahead of the Christmas holiday that left the benchmark S&P 500 index on the edge of what Wall Street calls a bear market. Technology companies and retailers drove much of the market’s rally. Crude oil prices rose.

KEEPING SCORE: The S&P 500 index rose 26 points, or 1.1 percent, to 2,377 as of 10 a.m. Eastern Time. The Dow Jones Industrial Average climbed 178 points, or 0.8 percent, to 21,970. The Nasdaq gained 107 points, or 1.7 percent, to 6,300. The Russell 2000 index of smaller-company stocks picked up 11 points, or 0.9 percent, 1,278.

ON THE BRINK: Wednesday’s gains provide the S&P 500 some breathing room after finishing the shortened trading session Monday just shy of a 20-percent drop from its peak three months ago. That’s what Wall Street calls a bear market, and it would have marked the end to the longest bull market for stocks in modern history after nearly 10 years.

Stocks fell sharply Monday after President Donald Trump lashed out at the central bank. Administration officials had spent the weekend trying to assure financial markets that Fed chairman Jerome Powell’s job was safe. On Tuesday, Trump reiterated his view that the Federal Reserve is raising interest rates too fast, but called the independent agency’s rate hikes a “form of safety” for an economy doing well.

The market’s sharp downturn since October intensified this month, erasing all of its 2018 gains and nudging the S&P 500 closer to its worst year since 2008. Stocks are also on track for their worst December since 1931, during the depths of the Great Depression.

TECH RALLY: Technology stocks accounted for much of Monday’s early bounce. Microsoft rose 3 percent to $96.89. Payment processors Visa and Mastercard also headed higher. Visa added 3 percent to $125.32, while Mastercard gained 3.5 percent to $180.82.

THANKS, SANTA: Big retailers were among the gainers. Amazon climbed 4.2 percent to $1,400, while Macy’s gained 3.3 percent to $29.08.

BUYBACK BOOST: JD.com rose 1.5 percent to $20.02 after the Chinese e-commerce company’s board authorized a stock buyback program of up to $1 billion.

OIL: Benchmark U.S. crude added 1.4 percent to $43.11 a barrel in New York. Brent crude, used to price international oils, gained 0.6 percent to $51.10 a barrel in London.

The pickup in oil prices helped boost energy stocks. Marathon Petroleum rose 1.9 percent to $55.36.

BOND YIELDS: Bond prices were little changed. The yield on the 10-year Treasury note held steady at 2.75 percent.

CURRENCIES: The dollar strengthened to 110.57 yen from 110.41 yen on Monday. The euro weakened to $1.1387 from $1.1404.

MARKETS OVERSEAS: Markets in Europe, Hong Kong and Australia were closed. South Korea’s Kospi gave up 1.3 percent, while Japan’s Nikkei 225 index, which plunged 5 percent on Tuesday, picked up 0.9 percent. Shares fell in Taiwan, Singapore and Indonesia, but rose in Thailand.