No. 2 U.S. homebuilder D.R. Horton Inc reported a quarterly profit and a sharp increase in orders on Friday, surprising Wall Street and sending shares up across the sector.

Horton, whose shares touched a nearly two-year high, extended a trend of improving results from homebuilders as its longstanding practice of building plenty of ready-to-sell homes enabled it to capture any increase in demand fueled by the tax credit expiring tonight.

Orders rose more than analysts expected as Horton exploited urgency on the part of buyers rushing to meet the tax credit deadline. Orders are a key leading indicator for homebuilders, as contracts signed in one quarter often do not close until the next.

The company reported a 55 percent increase in orders to 6,438 compared with consensus estimates of 32 percent growth, Credit Suisse analyst Dan Oppenheim wrote in client note. He rates Horton's shares neutral.

Horton recorded net income of $11.4 million, or 4 cents per share, reversing a year-earlier loss of $108.6 million, or 34 cents per share.

The results topped Wall Street's expectations, as analysts had anticipated a loss of 1 cent per share, according to Thomson Reuters I/B/E/S.

Revenue rose 15.7 percent to $896.8 million.

Relatively conservative builders, like the Ryland Group who prefer to wait until they have a buyer before building, were at a disadvantage this quarter as builders must deliver homes by June 30 to qualify them for the tax credit.

Ryland posted a 13.4 percent drop in orders when it reported results on Wednesday and shares fell about 4 percent the next day.

Horton's success in snagging tax credit buyers should fuel growth through June, wrote UBS analyst David Goldberg in a client note.

While impressed with the quarter's results, Goldberg believes Horton's share price is expensive and could fall as demand declines after the tax credit expires. He rates Horton's shares a sell.

The company, which trails Pulte Group Inc in size, will keep its focus on building low-cost houses for first-time buyers, he said.

The results marked the Fort Worth, Texas-based company's second consecutive profitable quarter after almost three years of losses.

Horton's shares were up 5.5 percent at $15.02 during early trading on the New York Stock Exchange. They touched a high of $15.44, marking its highest level since May 2008.

Homebuilder shares were up about 3 percent as measured by the Dow Jones U.S. Home Construction Index <.DJUSHB>, while the S&P 500 <.SPX> was flat.

Pulte, which became the largest U.S. builder following its acquisition of Centex, is due to report results next week.

(Reporting by Scott Malone; Editing by Derek Caney and Lisa Von Ahn)