Energy shares buoyed U.S. stocks on Friday as Chevron Corp's upbeat outlook gave a boost to the sector, while wholesale inventories data supported bets on an improving economy.

The S&P energy sector <.GSPE>, up 1 percent, led the market's advance, with Chevron up 2.4 percent at $79.50 a day after it said its refining and marketing arm would return to profit in the first quarter, while earnings from oil and gas production would grow.

Among other leaders in the sector, ConocoPhillips gained 2.5 percent to $55.29, and Exxon Mobil Corp rose 1.4 percent to $68.84.

Data showed U.S. wholesale inventories rose more than expected in February and sales at wholesalers reached their highest level in 16 months, brightening prospects for first-quarter economic and earnings growth.

A combination of the strong retail sales number yesterday and the stronger-than-expected inventories report today is helping support the market, said Todd Salamone, vice president of research at Schaeffer's Investment Research in Cincinnati.

I think it confirms that we could be on the heels of a stronger-than-expected recovery.

The Dow Jones industrial average <.DJI> added 37.63 points, or 0.34 percent, to 10,964.70. The Standard & Poor's 500 Index <.SPX> gained 4.46 points, or 0.38 percent, to 1,190.90. The Nasdaq Composite Index <.IXIC> rose 10.22 points, or 0.42 percent, to 2,447.03.

The three major stock indexes were on track for a sixth straight week of gains -- a positive run not seen since stocks rebounded from more than 12-year lows in March 2009.

Another lift for the energy sector came from Atlas Energy shares, which surged 17.8 percent to $37.47 after Indian energy company Reliance Industries agreed to pay $1.7 billion for a stake in an Atlas shale project to provide natural gas.

Department store operator J.C. Penney Co Inc rose 1.8 percent to $31.54 after Goldman Sachs added the stock to a list of recommended buys.

Palm Inc

jumped 11.6 percent to $5.19, capping a volatile week in which the smartphone maker's stock has seesawed on options market chatter and takeover rumors.

Worries about Greece's debt problems, which have weighed on stocks for weeks, eased after a European Union source said policy-makers had reached an agreement on terms of possible emergency loans for Athens. The U.S. dollar index <.DXY> slipped 0.5 percent, while the euro rose nearly 1 percent. Earlier, stocks pared gains on news that Fitch downgraded Greece's debt rating.

(Reporting by Leah Schnurr; Editing by Jan Paschal)