LONDON (MarketWatch) -- BP and Royal Dutch Shell on Tuesday both posted sharply higher quarterly earnings, handily surpassing most estimates as a nearly 70% rise in crude prices helped offset virtually flat oil production and skyrocketing costs.

The earnings bump in Europe sets the stage for profit reports from peers Exxon Mobil XOM, -2.91% and Chevron CVX, -2.74% later this week.

In early trading on the New York Stock Exchange, shares of BP and Shell both rose more than 4%. Other major oil shares edged higher as the Amex Oil Index XOI, -2.53% rose fractionally.

BP BP, -2.80% (BP) said its first-quarter earnings rose to $7.62 billion from $4.66 billion. Adjusting for the impact of energy-price changes on unsold inventory and other charges, BP would have earned $6.49 billion, trumping analyst estimates by over $1 billion.

At Royal Dutch Shell, RDS.A, -1.68% (RDS.A) net profit rose to $9.08 billion from $7.28 billion. Adjusted for the impact of energy-price changes on unsold inventory and $77 million in charges, Shell said it would have earned $7.7 billion, up 5% from a year earlier and above the $6.77 billion that analysts had forecast.

For both companies, production growth stalled. It was essentially unchanged for BP at 3.91 million barrels of oil equivalent a day, while Shell saw only a 1% rise to 3.44 million barrels.

But BP sold its oil and gas for 52% more than it did in the year-earlier period, as Shell received 66% more. That led BP's exploration-and-production arm to earn $10.1 billion, up 60%, and Shell's E&P arm to earn $5.14 billion, up 52%.

"The consensus thrashing first-quarter results, clearly aided by high oil and gas prices, have nevertheless shown that (BP's) turnaround is well advanced," said Richard Griffith, an analyst at Evolution Securities. Griffith was similarly effusive about Shell, calling their results "stellar."

Analysts said BP's refining performance wasn't as bad as forecast, and Shell's gas sales in Europe were helped by a cold winter.

Both BP and Shell have put in a strong month's performance on the back of rising oil prices that traded near $120 a barrel.

Shell CFO Peter Voser repeated the company's claim that oil prices aren't justified by fundamentals but said oil and gas prices will rise from here.

Oil also a cost

But oil also is a cost for these companies as they refine oil into gasoline and jet fuel.

Excluding a gain from contributing its Toledo refinery into a venture with Husky Energy, and BP's refining and marketing arm reported a 29% profit fall. At Shell, the profit fall in its oil products division excluding charges was 20%.

In other divisions, Shell's gas and power unit reported an 18% profit rise, helped both by strong liquefied natural gas prices and increased LNG volumes, and it doubled its profit in its oil sands division to $249 million despite lower volumes and higher costs.

BP upped its dividend by 31% and Shell increased its dividend by 11%.