Stocks post second-best weekly gains of the year

Stocks were mixed on Friday but but major averages rallied sharply for the week, with the Dow and S&P 500 posting their second-best weekly gains this year.

The Dow Jones Industrial Average, which had surged 1 percent to a record-breaking finish on Thursday, closed just 3 points ahead, at 15,464.30. Boeing led the blue-chip laggards, while Bank of America rose.

The S&P 500 and the Nasdaq finished higher for the seventh-consecutive session. The CBOE Volatility Index (VIX), widely considered the best gauge of fear in the market, slipped below 14.

Among key S&P sectors, financials led the gainers, while industrials slipped.

Boeing slumped 5 percent following a fire on one of the company's troubled Dreamliner airliners at London's Heathrow Airport. Earlier, the airplane maker's stock had hit an all-time high at $108.15 a share.

"This is bit of an intermission but it's probably normal after some of the moves we've seen recently," said Lawrence Creatura, portfolio manager at Federated Investors.

"It wouldn't be unusual to see a bit of a pullback after this strong run, but we're in earnings season, where the results will dominate all other variables—expectations are quite low and management teams seem to have done a good job of setting the bar at ankle height, so it seems likely that we'll have more positive surprises."

Among earnings, JPMorgan Chase edged higher after the Dow component and the largest U.S. bank by deposits beat expectations on both revenue and earnings. And Wells Fargo also gained after the financial company topped the Street on both ends.

They were the first major U.S. banks to report second-quarter earnings, setting the tone for the rest of the sector which will issue results throughout next week. Earnings expectations for JPMorgan in particular were high, as the bank has beaten analyst estimates in 12 of its last 13 earnings reports.

Major averages soared more than 1 percent on Thursday, with the Dow and S&P 500 closing at record highs, boosted by assurances by Fed Chairman Ben Bernanke that the central bank would not remove its stimulus policies for some time.

(Read More: Cramer: Should You Celebrate or Fear the All-Time High?)

On Friday, Philadelphia Federal Reserve President Charles Plosser said the Fed should wind down quantitative easing by the end of 2013. He said policy makers should treat 6.5 percent unemployment and 2.5 percent inflation targets as "triggers," not "thresholds."

On the economic front, producer prices gained 0.8 percent in June, according to the Labor Department, edging past expectations for 0.5 percent. Core producer prices, which exclude volatile energy and food costs, edged up 0.2 percent.

Meanwhile, Thomson Reuters/University of Michigan Surveys of Consumers' preliminary July consumer sentiment index fell to 83.9 from the final June figure of 84.1. Economists in a Reuters survey expected a preliminary July sentiment index reading of 85.0 compared with 84.1 in the final June report.

European shares pared their earlier gains to close slightly lower, after posting four days of successive gains. Meanwhile, the yield on Portugal's benchmark government bonds surged, following demands for a renegotiation of its bailout program.

After the European market close, Fitch slashed its credit rating on France to AA-plus from AAA with a "stable" outlook citing the country's uncertain economic outlook and the need for structural reform.

And shares in Asia traded cautiously ahead of Chinese growth data next week. China is expected to post second-quarter gross domestic product (GDP) numbers on Monday, after a slew of disappointing trade and manufacturing reports. Investors' nerves were piqued on Friday by reports that the Chinese finance minister was forecasting annual growth of only 7 percent, below the country's official growth target of 7.5 percent.

(Poll: Will China Experience a 'Hard Landing' in 2013?)

"We see no hard landing but rather steady growth. Our 7.7 percent GDP forecast is based on a stronger consumption component, making up for the slowdown in investment," wrote Steve Wang, research director at Reorient Markets, in a note.