NEW YORK (TheStreet) -- U.S. stocks staged a mighty comeback in the final hour of trading Wednesday as a message from European leaders in support of Greece assuaged investor fears that the country is on a path to exit the eurozone.

Wall Street was fixated on Europe all day with the region's leaders set to meet in Brussels to discuss latest developments in the region. Indications that eurozone countries were told to prepare contingency plans for a possible exit of the single-currency bloc by Greece and the stern rejection of a proposal to issue eurobonds by Germany, the strongest member of the eurozone, sent the major U.S. equity indices sharply lower for most of the session and led to tumultuous trading across asset classes, most notably pushing the euro toward a two-year low.

But late in the session, reports came that leaders were reaffirming support for Greece at the meeting. A

draft statement

about the results of the "informal dinner" obtained by

Dow Jones

reads: "We look forward to the swift formation of a new government that will take ownership of the adjustment program and have a sufficient parliamentary majority to implement with determination the fiscal and structural reforms needed. This is the best guarantee for a more prosperous future of Greece in the euro area."

The

Dow Jones Industrial Average

dipped less than 7 points, or 0.05%, to close at 12,496, erasing an almost 200-point drop in the last hour of trading. The blue-chip index traded as low as 12,311 earlier in the session.

The

S&P 500

tacked on 2 points, or 0.17%, to finish at 1319, and the

Nasdaq

rose 11 points, or 0.39%, at 2850. The indices scraped respective lows of 1296 and 2795 during the day.

Selective buying in materials, transportation and capital goods sectors helped stocks stage a late recovery.

Breadth within the Dow was mixed with 15 out of the 30 components finishing in the red.

General Electric

TICKER TYPE="EQUITY" SYMBOL="GE"/> was unchanged.

The largest percentage decliners were

Hewlett-Packard

(HPQ) - Get Report

,

Microsoft

(MSFT) - Get Report

,

Intel

(INTC) - Get Report

,

Procter & Gamble

(PG) - Get Report

, and

Pfizer

(PFE) - Get Report

.

Wal-Mart

(WMT) - Get Report

,

Alcoa

(AA) - Get Report

and

Bank of America

(BAC) - Get Report

were the prominent gainers on the Dow.

Hewlett-Packard shares took a big hit ahead of its quarterly report after the closing bell. The big miss and tepid guidance of rival

Dell

(DELL) - Get Report

after Tuesday's closing bell raised concerns about the performance of HP.

After the bell, though, the company reported second-quarter profit excluding items of 98 cents per share, beating expectations and announced plans to layoff 27,000 people, sending shares higher by more than 5% in after-market trading.

Dell shares shed 17%, hitting a session low of $12.31, a level unseen in three years. Volume of more than 100 million was six times the issue's trailing three-month daily average churn.

In the broader market, the number of winners ended up outpacing losers on both the

New York Stock Exchange

and the

Nasdaq

, a huge reversal of morning trading when the breadth was very negative.

London's FTSE settled down 2.5%, and the DAX in Germany closed lower by 2.3%.

On Wednesday, Germany managed to sell €4.56 billion ($5.8 billion) of new two-year bonds with a 0% coupon and average yield of just 0.07%, highlighting the earlier anxiety among investors about a Greek eurozone exit and their strengthened desire for safe-haven assets.

In Asia, the Hang Seng Index in Hong Kong settled down 1.3% and Japan's Nikkei average closed lower by 2%.

Meantime, the Congressional Budget Office warned late Tuesday that the U.S. economy could slip into a recession in the first half of 2013 as the nation heads towards a "fiscal cliff" in January that could suck more than $500 billion from the economy in 2013.

After surging for much of the day, the benchmark 10-year Treasury was down 2/32, lifting the yield to 1.746%. The greenback was rising 0.45%, according to the

dollar index

.

In other U.S. economic news, the Department of Commerce reported that new single-family home sales rose 3.3% to a seasonally adjusted 343,000-unit annual rate in April, from an upwardly-revised 332,000 in March. The April rate was better-than the 335,000 figure economists surveyed by

Thomson Reuters

were expecting.

The July crude oil contract slipped below the $90-mark for the first time since November to settle at $89.90 a barrel. June gold futures fell $28.20 to settle at $1,548.40 an ounce.

In corporate news,

Facebook

(FB) - Get Report

and banks including

Morgan Stanley

(MS) - Get Report

were being sued by the social networking giant's shareholders,

Reuters

reported. The plaintiffs said the defendants hid Facebook's weakened growth forecasts ahead of its $16 billion initial public offering, according to the report.

Facebook shares gained 3%, rising after steep declines in the past two sessions. Shares of Morgan Stanley added 0.4%.

PetSmart

(PETM)

was a standout gainer in Wednesday's trading, advancing more than 13% after its above-consensus performance in the first quarter. The pet products retailer posted earnings of $94.7 million, or 85 cents a share, up from a profit of $70.9 million, or 61 cents a share, in the same period a year earlier, and well ahead of the average analysts' estimate of 73 cents a share.

Starbucks

(SBUX) - Get Report

was also holding its own, tacking on 3.6% following an upgrade to buy at Bank of America Merrill Lynch. The firm, which previously had a neutral rating, also lifted its 12-month price target o $68 from $65 and boosted earnings estimates.

"SBUX has corrected by about 14% since its April high and subsequent March quarter earnings release with the weakness, in our opinion, is more a function of pre-release investor expectations getting too high than any significant fundamental issue," B of A said. "SBUX is positioned, in our view, for strong EPS growth in FY 2013-14 - at or in excess of the high end of targeted 15%-20% growth."

-- Written by Andrea Tse and Shanthi Bharatwaj in New York.

>To contact the writer of this article, click here:

Andrea Tse

.