Higher oil prices boosted quarterly profits for Exxon Mobil Corp and ConocoPhillips , but Exxon saw its earnings hurt by recently enacted U.S. health reform legislation.

The healthcare costs and weak performance from its refineries pulled Exxon's earnings below Wall Street forecasts, a stark contrast with rivals BP Plc and Royal Dutch Shell Plc , which both topped market expectations when they released quarterly figures earlier this week.

Benchmark U.S. oil prices averaged nearly $79 a barrel in the first quarter, about $3 above the quarter before and sharply higher than the $43 average of the first quarter of 2009.

That strength offset weak margins from Exxon and Conoco's refinery operations, which have been hurt by weak demand for fuels such as gasoline and diesel because of the soft global economy. However, the steady rebound in many regions is expected to pull up fuel demand later this year.

Our results reflect higher crude oil realizations and stronger chemical margins while the downstream industry margins remained weak, Rex Tillerson, Exxon's chief executive, said in a statement on Thursday.

Exxon's shares slipped 0.3 percent to $68.96 on the lower-than-expected earnings, but the losses were limited by the nearly $2 jump in crude oil prices on Thursday.

Conoco's shares rose by 2.2 percent to reach $59.84 per share.

Smaller exploration companies Apache Corp and Occidental Petroleum Corp also saw profits rise in the first quarter, benefiting from a near doubling in the price of crude oil from a year earlier.

RISING CRUDE

Exxon's profit in the quarter rose 38 percent to $6.3 billion, or $1.33 per share.

Jason Gammel, oil analyst at Macquarie Research, characterized Exxon's first-quarter profit as a pretty big miss, and attributed the bulk of the shortfall to Exxon's accrual for the health care legislation.

That legislation sapped earnings by $200 million, or about 4 cents per share. Wall Street analysts had expected Exxon to report a profit of $1.41 per share, according to Thomson Reuters I/B/E/S.

The company' oil equivalent production rose 4.5 percent from a year ago, fueled by the company's liquefied natural gas (LNG) projects in Qatar, it said.

The production numbers looked great, I was looking for 2.5 percent growth, Gammel said.

But Exxon's downstream arm, which includes its refining and marketing operations, posted profits of $37 million, well off the $1.1 billion it earned a year ago.

Conoco, the third-largest U.S. oil company by market share, saw its profits rise sharply to $2.1 billion, but oil and gas output in the quarter fell to 1.83 million barrels of oil equivalent (BOE) per day from 1.93 million BOE per day a year ago.

Occidental Petroleum's first-quarter profit tripled from a year earlier to $1.1 billion, or $1.32 per share, while Apache Corp swung to a profit of $705 million, or $2.08 per share, from a $1.76 billion loss last year.

In London, gas producer BG Group reported a 5 percent fall in first-quarter net profit to $960 million as a glut in the global gas market hit gas prices, but underlying profits rose, beating expectations, and its shares climbed.

(Additional reporting by Tom Bergin in London and Braden Reddall in San Francisco)