Stocks were little changed on Friday, hovering around highs not seen since June 2008, while energy shares gained alongside crude oil prices.

The S&P 500 has risen over four of the past five days and is up 8.4 percent for the year. The swiftness and magnitude of the gains have created concern a pullback could be in sight.

The benchmark S&P 500 index was not far from 1,370, considered the upper end of a technical barrier and a level not since 2008. Over the past four sessions, the S&P has hovered around 1,360 and closed at a 9-month high on Thursday.

We've touched these significant points and they haven't shown a lot of support. That makes me want to look at the short term with a cautious eye, said Joseph Cangemi, managing director at BNY ConvergEx Group in New York.

The S&P energy index rose 0.4 percent and was among the leading sectors as crude oil futures rose and were headed for a fifth straight weekly gain. Investors have worried that a recent spike in crude prides could weigh on consumer spending.

Gains have come on the back of hopes that Europe was making progress in dealing with the sovereign debt crisis as well as improved domestic economic data.

The Dow Jones industrial average <.DJI> was down 5.57 points, or 0.04 percent, at 12,979.12. The Standard & Poor's 500 Index <.SPX> was up 2.01 points, or 0.15 percent, at 1,365.47. The Nasdaq Composite Index <.IXIC> added 3.30 points, or 0.11 percent, at 2,960.28.

Consumer sentiment improved in February, rising to a year high, according to the final monthly reading of the Thomson Reuters/University of Michigan's consumer sentiment index.

New U.S. single-family home sales fell in January, but an upward revision to the prior month's data and a drop in the supply added to signs of a budding recovery in the sector.

Equities barely moved after the data.

Both American International Group Inc and Salesforce.com Inc rallied a day after their earnings beat expectations. AIG climbed 4.6 percent to $29.29, and Salesforce was up 7.3 percent to $141.40.

J.C. Penney Co Inc fell 0.8 percent to $41.59 after swinging to a net fourth-quarter loss and posting a decline in same-store sales.

According to Thomson Reuters data through Friday morning, of the 461 in the S&P 500 reporting earnings, 63 percent topped expectations. That was below the 70 percent average beat in the past four quarters, but slightly above the average of 62 percent since 1994.

Kenneth Cole Productions Inc surged 20.3 percent to $15.72 after the company's chairman offered to take it private.

(Reporting by Ryan Vlastelica; editing by Jeffrey Benkoe)