NEW YORK (Reuters) - The S&P 500 rose marginally on Friday to mark its biggest weekly increase in five years, although earlier gains evaporated after the indictment of Russians for meddling in the 2016 presidential election sent investors into defensive mode before a long weekend.

A market correction sparked by inflation concerns earlier in February raised fears that a nine-year bull market had ended, but data on consumer prices and retail sales this week left investors less worried, returning the stock market to its upward trajectory.

The office of U.S. Special Counsel Robert Mueller charged 13 Russian nationals and three Russian companies accused of interfering with U.S. elections in an effort to support then-candidate Donald Trump.

The S&P 500 had been up over half a percent but lost nearly all of that after the announcement of the indictments.

“The market was looking for an excuse to roll over and Russia headlines would do it. You’ve had such a rally for the week, and people have been looking for an excuse to take profits heading into the weekend,” said Dennis Dick, a proprietary trader at Bright Trading LLC in Las Vegas.

Investors snapped up shares of Johnson & Johnson JNJ.N, Abbvie ABBV.N and Pfizer PFE.N, all up more than 1.4 percent and supporting the S&P 500 more than any other stocks.

A strong fourth-quarter reporting season and deep corporate tax cuts introduced this year have led analysts to increase their estimates for 2018 S&P 500 earnings growth to 19 percent from 12 percent in early January.

Traders work on the floor of the New York Stock Exchange shortly after the opening bell in New York, U.S., February 16, 2018. REUTERS/Lucas Jackson

“The fundamental story has not changed,” said Ben Phillips, Chief Investment Officer of EventShares. “We really have not seen the tax reform start flowing through yet into company earnings. We think it’s going to cause a second wave of earnings optimism.”

The Dow Jones Industrial Average .DJI rose 0.08 percent to end at 25,219.38 points, while the S&P 500 .SPX gained 0.04 percent to 2,732.22.

The Nasdaq Composite .IXIC dropped 0.23 percent to 7,239.47.

The Dow rose 4.25 percent for the week, its strongest weekly gain since November 2016.

The Nasdaq rose 5.31 percent for the week, its best week since December 2011.

The S&P 500’s 4.3 percent gain for the week was its biggest weekly advance since January 2013. But it remains down nearly 5 percent from its record high on Jan. 26.

U.S. stock markets will remain closed on Monday for the Presidents Day holiday. They are unlikely to return to the unusually calm conditions seen last year, even though equities have already recovered more than half the ground lost in the recent sell-off and traders have rapidly dialed down fear.

Economic data out on Friday painted a rosy picture. Homebuilding increased to more than a one-year high in January, boosted by strong increases in the construction of single- and multi-family housing units. A different report showed import prices jumped last month.

The CBOE volatility index .VIX, known as Wall Street's fear gauge, edged up to 19.4 but remained way off the 50-point level it hit during the peak of the sell-off.

Coca-Cola KO.N rose 0.45 percent after the company reported better-than-expected profit and sales as it sold more teas, coffees and vitamin water.

Among the big decliners was Kraft Heinz KHC.O, which dropped 2.63 percent after quarterly profit and sales missed analysts' estimates.

Advancing issues outnumbered declining ones on the NYSE by a 1.43-to-1 ratio; on Nasdaq, a 1.34-to-1 ratio favored advancers.

Volume on U.S. exchanges was 7.1 billion shares, below the 8.5 billion average for the full session over the last 20 trading days.