Energy shares helped the Dow and S&P 500 end a three-day losing streak on Tuesday, even as investors worried rising fuel costs will undercut economic growth.

Earnings reports from smaller companies, including homebuilder Lennar and store chain Sears Holdings, also supported stocks, but volume was low for a second day, raising questions about the sustainability of the longer term rally.

The S&P Energy sector rose 1.2 percent on a 2 percent rally in the price of oil, but transportation and consumer stocks weakened on worries about higher energy costs.

There's a big feeling we're going to have $100 barrel oil pretty quickly, said Shawn Hackett, president at Hackett Advisors in Boynton Beach, Florida.

He said that is clearly bullish for the sector, but oil above $90 a barrel could take disposable income away from the economy and could hurt demand.

Sears Holdings Corp rose 6.3 percent to $75.02 after the company raised its profit outlook above Wall Street estimates, citing strong sales.

Lennar Corp gained 7.4 percent to $20.30 after reporting fourth-quarter results higher than expected. The PHLX Housing sector index <.HGX> gained 1.7 percent.

Alcoa Inc posted a quarterly profit that topped Wall Street's expectations but the aluminum maker's shares fell 1 percent to $16.33.

The Dow Jones industrial average <.DJI> gained 34.43 points, or 0.30 percent, to 11,671.88. The Standard & Poor's 500 Index <.SPX> added 4.73 points, or 0.37 percent, to 1,274.48. The Nasdaq Composite Index <.IXIC> rose 9.03 points, or 0.33 percent, to 2,716.83.

Stocks had rallied previously on optimism about profits, but the Dow and S&P 500 ended down the past three sessions.

Short-term technical resistance for the benchmark S&P is seen around 1,280 while the area between 1,265 and 1,260 provides support.

About 7.2 billion shares traded on the New York Stock Exchange, the American Stock Exchange and Nasdaq, below last year's estimated daily average of 8.47 billion.

Advancing stocks outnumbered declining ones on the NYSE by 1,756 to 1,213, while on the Nasdaq, more than five stocks rose for every three that fell.

Verizon Communications Inc fell 1.6 percent to $35.36 after Verizon Wireless announced it will begin selling a version of Apple Inc's iPhone. The news, which was expected, had been preceded by a rise of more than 11 percent in Verizon shares in the past six weeks.

Women's clothier Talbots Inc tumbled 17.4 percent to $6.25 after it forecast a much bigger-than-expected quarterly loss.

MBIA Inc rose 10.2 percent to $13.53 after a divided New York appeals court handed the bond insurer a crucial win in the legal battle over its restructuring plan.

(Reporting by Rodrigo Campos; Editing by Kenneth Barry)