NEW YORK (TheStreet) -- Gains in energy stocks helped the market make a comeback Friday, even after the week's soft housing data was capped by Friday's disappointing read on new home sales.


Dow Jones Industrial Average

was up 34.6 points, or 0.3%, at 13,081 and the

S&P 500

edged up 4.3 points, or 0.3%, at 1397. The


was higher by 4.6 points, or 0.2%, at 3068, as


(AAPL) - Get Report

shares pared losses after a mini flash crash.

The energy sector, along with basic material stocks led the market's gains, each up about 0.9%. Energy stocks moved up as crude oil prices gained ground. May oil futures settled up $1.52 to $106.87 a barrel after expectations of a reduction in Iranian crude imports.

Dip buyers came in during Friday's session, noted James "Rev Shark" Deporre in a

RealMoney blog post. "They don't care whether the bears think the market is doomed. They are going to chase the action if they can make a buck and if they can squeeze some skeptics, so much the better."

"The latest rally to new bull market highs this week was once again not confirmed by daily momentum, and we still expect some type of pullback before the last shot higher," wrote Mark Arbeter, chief technical strategist with S&P Capital IQ, in an afternoon note.

The gains came despite some disappointing economic data. The Census Bureau today reported disappointing sales for new single-family homes in February. The bureau said that sales of new single-family homes fell 1.6% to a 313,000 seasonally adjusted annual rate last month from a downwardly revised January rate of 318,000, but was 11.4% above the February 2011 estimate of 281,000. Economists surveyed by

Thomson Reuters

were expecting a rise of new home sales to a 325,000 annual rate last month.

Housing data in the week suggest that the sector remains a drag on the economy. Earlier in the week, the Commerce Department reported that February housing starts fell to a 698,000 annual pace from an upwardly revised 706,000 clip the previous month. Building permits for February rose to a notably better than expected 717,000 rate from 682,000 in January. The National Association of Realtors reported that February existing-home sales slipped 0.9% to a seasonally adjusted annual rate of 4.59 million in February, from an upwardly revised 4.63 million in January.

"Overall, a disappointing release from the housing sector -- consistent with the week's theme of this softer housing data," said Ian Lyngen, senior strategist, CRT Capital Group.

In reflection of the still shaky market, homebuilder

KB Home

(KBH) - Get Report

TheStreet Recommends

said today its revenue for the quarter ended February 29 totaled $254.6 million, much lower than the $337.7 million analysts were expecting. The company also saw a net loss of $45.8 million, or 59 cents a share, compared to estimates for a loss of 24 cents a share.

The announcement was a huge disappointment given that analysts were expecting the company to blow past expectations. The company had profited in the quarter ended last November after three straight quarterly losses, leading some to believe that it had seen a turnaround along with the broader housing market. Shares were plunging 8.7% to $10.26 on the news.

Looking abroad, London's FTSE rose 0.16% on Friday and Germany's DAX added 0.21% after the Nationwide Building Society said that consumer confidence in the U.K. fell in February amid increasing joblessness and feeble economic growth. Meanwhile, Spanish and Italian bonds yields kept rising, with the ten-year climbing above 5% in both countries amid ongoing European debt fears.

In Asia, Japan's Nikkei Average closed down 1.14% and Hong Kong's Hang Seng index also finished in negative territory, down 1.11%.

In other corporate news,


(NKE) - Get Report

, the sneaker maker, posted third-quarter profit ahead of consensus estimates. Beaverton, Ore.-based Nike earned of $560 million, or $1.20 a share, on revenue of $5.85 billion for the quarter ended Feb. 29, beating the average earnings estimate of analysts of $1.17 a share on revenue of $5.82 billion. Gross margin came in at 43.8% for the quarter, down from 45.8% a year earlier. Shares fell 3.2% to $107.42.

Shares of iPad and iPod maker Apple have resumed trading, down 0.6% to $596.01, after being halted for a circuit breaker. A single trade for 100 shares executed on a

Bats Global Markets

venue briefly sent Apple down 9% to $542.80, triggering a circuit breaker that paused the shares for five minutes this morning,


reported. Bats, which went public Friday, attributed its embarrassing start to a system crash. Apple's stock finished down 0.6% to $596.05.

Darden Restaurants

(DRI) - Get Report

, the parent of Red Lobster and Olive Garden, reported third quarter earnings of $1.25 a share, up from $1.08 a year earlier, and slightly higher than analyst expectations for it to post profit of $1.24 a share. Sales grew to $2.16 billion, also beating the forecast $2.14 billion.

The restaurant group said that sales grew 4.1% compared to the period a year earlier at Red Lobster, Olive Garden and LongHorn Steakhouse amid favorable weather conditions, underlying business strength and deceleration in food cost inflation over the year. The company also announced a quarterly cash dividend of 43 cents a share, payable on May 1. Shares slid 1.8% to $50.92.

April gold futures added $19.90 to $1,662.40 an ounce.

The benchmark 10-year Treasury was ahead by 14/32, diluting the yield to 2.24%, while the U.S. dollar index was down 0.5% to $79.34.

-- Written by Andrea Tse and Chao Deng in New York.

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

Andrea Tse