By Victor Reklaitis and Carla Mozee, MarketWatch

NEW YORK (MarketWatch) -- U.S. stocks closed with solid gains Friday, leaving the S&P 500 with its largest weekly advance of the year.

Markets got a lift from stronger-than-anticipated housing data and better-than-expected quarterly results from companies such as Procter & Gamble Co. and Microsoft Corp. Investors shook off worries about New York's first Ebola case, which had weighed on U.S. stock futures.

The S&P 500 (SPX) finished up 13.76 points, or 0.7%, at 1,964.58. The benchmark rose 4.1% for the week, its biggest weekly percent gain since January 2013. It snapped a four-week losing streak, bouncing back after slumping to a six-month intraday low in last week's volatile action.

The Dow Jones Industrial Average (DJI) closed up 127.51 points, or 0.8%, at 16,805.41, as the blue-chip barometer achieved a 2.6% gain for the week. The Nasdaq Composite (RIXF) finished up 30.92 points, or 0.7%, at 4,483.72. The tech-heavy index climbed 5.3% for the week.

Today's key headlines: The Commerce Department said Friday that sales of new homes in September rose slightly an annual rate of 467,000, hitting a six-year high, topping expectations.

Investors are looking ahead to results of stress tests for European banks, which come as data show slowing growth in Europe. The release is expected on Sunday, although a Bloomberg report on Friday said 25 banks could fail the tests. Check out: 5 things to know about the ECB stress tests

Also around the corner is next week's Federal Reserve policy meeting. The Fed is expected to end its third-round of bond buying, which had been aimed at helping the U.S. economy emerge from the 2008 financial crisis.

"The central question then that traders will be asking (assuming Ebola looks to be contained) will be whether the Fed removes the 'considerable period' for keeping the funds rate low," said Chris Weston, chief market strategist at IG, referring to the Fed's policy statement in a Friday note. It's likely the Fed will "continue to see rates staying low for a considerable period of time and remain confident in its economic outlook, thus sending a message of confidence to the market," Weston wrote.

Overnight, U.S. stock threatened to head south early in the morning, following news late Thursday that a New York doctor has contracted the deadly Ebola virus. The positive Ebola-test for the doctor marked the first such case in the city. Treasurys strengthened "as [the] Ebola-scare in New York spurred the safe-haven demand for bonds," ICICI Bank wrote in a note.

Movers & Shakers: Procter & Gamble (PG) shares climbed 2.3% for one of the best performances among Dow components. The consumer-goods heavyweight said it plans to get out of its Duracell battery business and posted adjusted quarterly earnings that matched expectations.

Microsoft Corp. (MSFT), the Dow's biggest gainer on Friday, picked up 2.5% after the tech titan posted quarterly profit and revenue that topped forecasts.

Meanwhile, Amazon.com Inc. (AMZN) dropped 8.3% after the online retailer reported a wider-than-expected third-quarter loss late Thursday. Amazon was the S&P 500's worst performer on Friday.

(Read more about today's jumpiest stocks in the Movers & Shakers column http://www.marketwatch.com/story/ford-ups-nasdaq-earnings-in-focus-2014-10-24.)

Other markets: In Asia, the Nikkei Stock Average rose 1% but Hong Kong's Hang Seng Index shed 0.1%. European stocks moved lower. Gold futures (GCZ4) were higher, while oil futures (CLZ4) lost ground.

--MarketWatch's William Watts contributed to this report.

Subscribe to WSJ: http://online.wsj.com?mod=djnwires

Amazon.com (NASDAQ:AMZN)
Historical Stock Chart
From Feb 2024 to Mar 2024 Click Here for more Amazon.com Charts.
Amazon.com (NASDAQ:AMZN)
Historical Stock Chart
From Mar 2023 to Mar 2024 Click Here for more Amazon.com Charts.