By Ron Bousso and Karolin Schaps

LONDON (Reuters) - Royal Dutch Shell and BP on Tuesday joined peers in reporting higher than expected earnings by making further deep cuts in spending to cope with an oil price downturn now in its third year.

The companies said they were well on the way to adapting to the more than halving in prices. But any new sharper downturn would test their ability to invest for growth and retain the relatively large dividends their shareholders expect.

Shell's stock rose by over 4 percent as it announced higher quarterly earnings than arch-rival U.S. Exxon Mobil, the world's largest listed oil company by output and market capitalization.

The Anglo-Dutch major, which acquired rival BG for $54 billion earlier this year, had been under pressure to cut costs after second quarter earnings came in around 50 percent below forecasts.

By contrast, BP's stock fell by more than 4 percent by 1210 ET as some analysts said its results were boosted by a one-off tax gain, meaning its longer-term profits and ability to pay dividends could still be at risk. The oil price was trading flat on the day at around $49 a barrel.

Shell's Chief Executive Officer Ben van Beurden said the oil sector had yet to emerge from troubled waters, but huge cost savings meant oil majors were getting closer to balancing their operations at today's oil prices of around $50 a barrel.

The prospects for an oil price recovery are still unclear, van Beurden said, despite attempts by OPEC and other producers to agree a deal to limit output and reduce the global glut which has pushed oil prices down by 50 percent since June 2014.

"Lower oil prices continue to be a significant challenge across the business, and the outlook remains uncertain," van Beurden said.

FUTURE FOCUS

The world's top oil and gas companies, including Exxon and Chevron, reported sharp drops in quarterly results last week due to lower oil prices and weaker refining margins.

But at the same time, most have shown they were adjusting to the new environment, with both Exxon and Chevron also beating earnings expectations. Chevron plans to focus future growth on U.S. onshore shale production, where investments are smaller and production starts faster compared to large offshore projects.

Shell also sees shale production as a key future growth engine. Its Chief Financial Officer Simon Henry said the oil-rich Permian Basin in West Texas was a "crown jewel".

Exxon warned it may need to slash proved oil and gas reserves on its books by nearly 20 percent, or some 4.6 billion barrels, if oil prices stay low for the rest of 2016.

French oil major Total also beat third quarter income expectations helped by cost cuts and new projects and only smaller rivals Norway's Statoil and Italy's ENI missed expectations due to lower-than-expected output. BP Chief Financial Officer Brian Gilvary said the British company was on track to rebalance cash flows next year at $50 to $55 a barrel and its future focus areas would include Russia and areas where it could bring technology to bear.

"This allow us to sustain our dividend whilst still investing enough to grow long term," he said.

In 2014, the world's top oil companies required an oil price of $113 a barrel in order to cover their spending and dividends, according to Jefferies analysts. The breakeven dropped to around $60 a barrel in 2016 and is expected to hover at around $50 a barrel next year.

BP benefited from UK fiscal regime changes, resulting an a $164 million tax credit in the third quarter, compared with a $1.16 billion tax bill in the same quarter last year.

"Despite mixed numbers and a modest increase in gearing, the overall trend in cost and capex savings and cash flows at BP continues to head in the right direction," analysts from Morgan Stanley said in a note.

BP reported a near halving in third-quarter earnings and slashed another $1 billion from its 2016 investment plan, while Shell saw an 18 percent rise in profits and lowered next year's capital spending to the bottom of the expected range.

Both Shell and BP maintained their dividends unchanged as expected.

At $2.8 billion in the third quarter, Shell's net income was above Exxon's third quarter net income of $2.65 billion.

Exxon has not made a big acquisition for more than 5 years but it is still worth more than Shell - its market cap was $345 billion as of Tuesday while Shell was worth $205 billion.

As well as slashing spending, oil companies have scrapped new projects, cut tens of thousands of jobs, renegotiated supply contracts and increased borrowing since prices began a sustained fall in June 2014.

All the majors apart from Eni have maintained or increased their dividends throughout the downturn to retain shareholder loyalty. Shell has not cut its dividend since World War Two.

(additional reporting by Christoph Steitz in Frankfurt; editing by Philippa Fletcher)