The S&P 500 closed at a record on Friday, capping off Wall Street’s strong rally this week, despite inflation hitting a 39-year high.

The S&P 500 rose 0.95% to 4,712.02 to close at a record. The 500-stock average sits 0.7% from its all-time high. The Dow Jones Industrial Average gained 216.30 points, or 0.6%, to 35,970.99. The technology-focused Nasdaq Composite climbed 0.7% to 15,630.60.

The Dow Jones Industrial Average rose 4% since Monday, snapping a 4-week losing streak. The 30-stock index had its best weekly performance since March. The S&P 500 and Nasdaq Composite added 3.8% and 3.6%, respectively, this week — the best since February for both indexes.

Inflation soared 6.8% year-over-year in November to highest rate since 1982, the Labor Department said Friday. The print came in slightly higher than the 6.7% Dow Jones estimate. The consumer price index, which measures the cost of a wide-ranging basket of goods, rose 0.8% for the month.

Core CPI, which excludes food and energy prices, rose 0.5% for the month and 4.9% from a year ago, in line with estimates.

Some investors may have been anticipating an even hotter inflation reading than economists, leading to a relief rally following the number. DoubleLine’s Jeffrey Gundlach said in a call this week he fears inflation could soon top 7%.

Friday’s CPI “number might show the most inflation in decades, but it still came in right about as expected. This is actually a good thing, as the market has priced in higher inflation, so this could be viewed as a relief,” said Ryan Detrick, chief market strategist at LPL Financial.

A bright spot of the CPI report was that increases in used cars, lodging, and airfares were all lower than expected, said Detrick. These areas have been stubbornly high and this could be one of the first signs that inflation could be nearing a peak, he added.

Investors are also wary that a high inflation reading could lead the Federal Reserve to hasten the taper of its $120-billion monthly bond-buying program.

Oracle shares soared 15.6% on Friday, a day after the company posted better-than-expected quarterly results.

Airlines ticked lower on Friday. Southwest Airlines dropped nearly 3.8% following another downgrade on Wall Street, this time from Goldman Sachs.

Interactive fitness company Peloton added to its woes, slipping about 5.4% after tumbling 11.3% on Thursday. Credit Suisse cut its view on the company, saying a return to gyms and shifts in consumer spending will weigh on profitability.

This material is provided by