U.S. stocks were little changed on Friday as energy shares gained modestly and investors took a breather from the financial crisis in Europe.

Traders also were positioning themselves for options expiration.

You're getting some short covering and some revaluation of the energy sector, said Nick Kalivas, senior equity index analyst at MF Global. But he added: We're kind of stuck here, waiting for some news.

The Dow Jones industrial average <.DJI> was up 27.17 points, or 0.26 percent, at 10,461.85. The Standard & Poor's 500 Index <.SPX> was up 2.18 points, or 0.20 percent, at 1,118.14. The Nasdaq Composite Index <.IXIC> was up 3.03 points, or 0.13 percent, at 2,310.19.

Energy shares rose with crude oil ending higher at $77.18 a barrel. Exxon Mobil Corp was up 1.1 percent at $63.30.

BP Plc's New York-traded shares slipped a day after its chief executive underwent a bruising appearance before a U.S. congressional committee over the Gulf of Mexico oil spill and the company said it would establish a $20 billion compensation and clean-up fund.

The S&P 500 is now down about 8 percent since the April 23 closing high for the year but had been down well over 10 percent largely because of worries over sovereign debt problems in Europe.

Traders said more volatility could be seen from the convergence of four key expirations, known as quadruple witching. Stock options expire later Friday, while index futures expired earlier in the session.

The futures and options expirations were going to be driving most of the flows at the moment ... especially given the fact we have a relatively quiet session, with much of Europe paying attention to the World Cup, and the U.S. this morning paying attention, said David Lutz, managing director at Stifel Nicolaus in Baltimore.

The June SPDR S&P 500 fund options, an exchange-traded fund that tracks the S&P 500 benchmark, is showing a light turnover volume ahead of expiration at the close later in the day, according to Jon Najarian, founder of options information website optionMonster.com.

Data from optionMonster.com suggests that with a lot of interest at the $112 strike price, the market could rally at the close if the S&P 500 gets close to 1120, which corresponds

with $112 for the fund.

Declining shares included Teva's U.S.-listed shares , Bayer said on Thursday Teva's U.S. unit admitted in court that some of the information included on packages of its oral contraceptive, Gianvi, was false and agreed to correct its labeling. Teva fell 1.9 percent to $53.20.

CVS Caremark Corp rose 2.5 percent to $32.62 and Walgreen Co added 3.5 percent to $30.30 after the companies patched up their fight over reimbursements for drug prescriptions, salvaging a relationship worth billions of dollars.

The S&P 500 has held above its 200-day moving average since Tuesday in a bullish signal but has found resistance near 1,121, a key level that marks the halfway point between the October 2007 historic highs and the lows of March 2009.

(Reporting by Edward Krudy; Editing by Kenneth Barry)