(Reuters) - Wall Street ended flat on Friday as gains by Intel, real estate companies and utilities offset a drop in Facebook after the social media network disclosed a security breach.

The S&P 500 lost 0.5 percent for the week, but for the third quarter it was up 7.2 percent, its best quarterly performance since the fourth quarter of 2013.

Facebook Inc FB.O slumped 2.59 percent for the session after it said it discovered a security issue affecting about 50 million accounts. Its loss weighed more than any other stock on the S&P 500.

Intel INTC.O jumped 3.08 percent and was the biggest boost on the three major indexes after the chipmaker said it was optimistic it would meet its full-year revenue target.

Smaller rival Advanced Micro Devices Inc AMD.O tumbled 5.22 percent. The Philadelphia SE Semiconductor index .SOX gained 0.65 percent, also boosted by Nvidia's NVDA.O 5.09 percent jump on bullish comments from Evercore ISI. The S&P 500 technology index .SPLRCT rose 0.43 percent.

Italy’s new government proposed a 2019 budget with a deficit three times bigger than the previous administration’s target, sparking a sell-off in European stock markets and a drop in U.S. Treasury yields as some investors shifted their focus to the United States.

“Italy is weighing on people’s minds as to where they want to be,” said Thomas Martin, senior portfolio manager at Globalt Investments in Atlanta. “The U.S. is the place to be, and the rest of the world - not so much.”

The S&P 500 utilities and .SPLRCU and real estate .SPLRCR indexes, which typically benefit from lower interest rates because of the dividends their components pay, were the strongest performers among 11 indexes, both up more than 1 percent.

The Dow Jones Industrial Average .DJI ended 0.07 percent higher at 26,458.31 points, while the S&P 500 .SPX was essentially unchanged at 2,913.98, down 0.02 point. The Nasdaq Composite .IXIC added 0.05 percent to 8,046.35.

Helping sentiment was Commerce Department data showing consumer spending rose steadily in August, while inflation stayed at the Federal Reserve’s 2 percent target.

“The theme of today is a continuation of solid economic numbers, as investors make comfortable positions ahead of the next quarter,” said Kate Warne, principal and investment strategist at Edward Jones in Des Peres, Missouri.

With the third quarter now wrapped up, investors will begin to focus on corporate financial reports due out in the next few weeks. Bolstered by a growing economy, deep corporate tax cuts and increased stock buybacks, S&P 500 companies are expected to report earnings per share up 21.6 percent over the year before, according to Thomson Reuters I/B/E/S.

Tesla TSLA.O sank 13.90 percent, its worst day since November 2013, after U.S. regulators sued Chief Executive Elon Musk, accusing him of fraud in a lawsuit that seeks to remove him as CEO, which could make it difficult for the loss-making electric-car maker to raise more capital.

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

The S&P 500 posted 26 new 52-week highs and 18 new lows; the Nasdaq Composite recorded 77 new highs and 73 new lows.

Volume on U.S. exchanges was 7.0 billion shares, compared to a 6.8 billion average over the last 20 trading days.