A late-afternoon recovery in technology stocks helped erase most of the market’s losses Friday, though it wasn’t enough to keep major indexes from posting their second straight losing week.

The S&P 500 eked out a 0.1 percent gain in the final minutes of trading after having been down about 1 percent earlier in the day. The tech-heavy Nasdaq came back from a 0.8 percent slide to post a 0.6 percent gain. The Dow Jones Industrial Average fell 0.6 percent.

The rally in technology stocks, plus gains in energy and other sectors, helped outweigh declines in banks and elsewhere in the market on a day when investors were mainly focused on a mix of company earnings reports and discouraging data on retail sales.

The mixed finish capped a week of choppy trading on Wall Street that deepened the market’s January slump. The benchmark S&P 500, which soared 26.9 percent in 2021, is now about 2.8 percent below the all-time high it set on Jan. 3.

“Stocks clearly are off to a slow start year-to-date, but perhaps for good reason,” said Terry Sandven, chief equity strategist at U.S. Bank Wealth Management. “There’s perhaps some profit-taking and time needed for digestion following those strong returns, particularly as we’re moving into a new regime of higher inflation and a Federal Reserve that’s less accommodative.”

The S&P 500 rose 3.82 points to 4,662.85, while the Nasdaq gained 86.94 points to 14,893.75. The Dow fell 201.81 points to 35,911.81.

The Commerce Department reported Friday that retail sales sank 1.9 percent in December after Americans cut their spending in the face of product shortages, rising prices and the onset of the omicron variant.

“That’s a lot of bad things to happen in a short amount of time in one of the strongest retail months of the year,” said Robert Cantwell, portfolio manager at Upholdings.

A wide range of retailers and other companies that rely on direct consumer spending fell following the weak retail sales report. Home Depot fell 3.9 percent and Whirlpool fell 4.3 percent.

The disappointing retail report is the latest in a series of economic reports this week that has raised concern about inflation and its impact on businesses and consumer spending.

The Labor Department reported on Wednesday that consumer inflation jumped at the fastest pace in nearly 40 years last month, a 7 percent spike from a year earlier that is increasing household expenses and biting into wage gains. The government agency also reported on Thursday that prices at the wholesale level surged by a record 9.7 percent for all of 2021.

Rising prices have been prompting businesses to pass more costs on to consumers. Consumers have been pulling back on spending at department stores, restaurants and online as a result of higher prices and supply shortages.

Businesses are also feeling the impact from inflation. Paint maker Sherwin-Williams fell 2.8 percent after reporting disappointing fourth-quarter earnings because of raw materials costs and supply chain problems. Boston Beer, which makes Sam Adams beer, slid 8.1 percent after cutting its earnings forecast because of supply chain problems.

Concerns over persistently rising inflation are also prompting the Federal Reserve to trim its bond purchases and consider raising interest rates earlier and more often than Wall Street had expected less than a year ago.

“Our belief is that the backdrop is still favorable for (stock) prices, but we’re seeing a reset in valuations, and that’s a function of interest rates trending a little higher,” Sandven said.

Bond yields rose. The yield on the 10-year Treasury rose to 1.79 percent from 1.70 percent late Thursday.

JPMorgan Chase slumped 6.2 percent for the biggest decline in the S&P 500 after reporting that its profits fell 14 percent in the latest quarter from a year earlier as its trading business slumped. Citigroup fell 1.3 percent after reporting its latest results.

The late burst of buying in technology stocks helped temper the market’s losses. Microsoft rose 1.8 percent

The price of U.S. crude oil rose 2.1 percent and helped send energy stocks higher. Marathon Oil rose 4.9 percent.

Smaller company stocks also bounced back from an early slide. The Russell 2000 index rose 3.02 points, or 0.1 percent, to 2,162.46.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.