BP saw profits fall by 26% in the third quarter as weak refining margins weighed on the business, which used to own the Grangemouth refinery.

Announcing it made an underlying profit of $3.7 billion (£2.3bn) in the three months to September, compared with $5bn in the same period last year, the oil and gas giant highlighted tough conditions in the refining businesses amid plentiful capacity around the world.

The announcement underlines the challenges facing the Grangemouth refinery, which was threatened with closure last week amid a bitter dispute between its owner Ineos and the Unite union.

However, BP's results beat analysts' expectations by $500 million, helped by a $99m saving from UK tax changes. It flagged up its enthusiasm for the UK noting that West of Shetland was one of the areas in which it was making "strategic progress".

BP plans to bring some giant developments off Shetland onstream in coming years, including the Clair Ridge field.

Chief executive Bob Dudley said the company planned to sell another $10bn assets by the end of 2015 under its plan to focus on the most profitable assets, without giving details.

He said the bulk of the money raised would be used to fund increased pay outs to investors in a move that reflected confidence in BP's prospects.

The company increased the third quarter dividend by 5.6% annually to 9.5 cents, from 9 cents, and held out the prospect of further increases.

Mr Dudley believes BP is well placed to fund capital investment of around $25bn this year. He said: "The strong operational progress we are now seeing across the group, combined with our focus on disciplined investment ...underpins our confidence in growing long-term sustainable free cash flow and being able to increase shareholder distributions."

However BP said there was still "significant uncertainty" about how much it would have to pay to settle all the claims and penalties relating to the Deepwater Horizon rig disaster in the Gulf of Mexico in 2010. The company increased its provision for the total expected cost by $30m in the quarter, to $42.5bn.

BP reduced provisions for claims for business loss by $400m after a court upheld BP's argument it should not have to pay where claimants could not show they suffered "actual injury traceable to loss from the Deepwater Horixon accident".

Analysts expected BP to make a third-quarter profit of around $3.17bn on a replacement cost basis, excluding the effect of changes in the value of stocks

BP's downstream business including refining operations made $720m compared with $3bn in the same period in 2012.

The company said: "We expect refining margins to remain under significant pressure due to very high gasoline stocks and new competitor capacity additions as well as lower seasonal demand."

The fall in profits also reflected the recent sale of two US refineries.

BP sold a package of downstream assets including the Grangemouth refinery to Swiss-based Ineos for £5.1bn in 2005

BP's exploration and production arm increased quarterly underlying replacement cost profits to $4.42bn from $4.36bn last time. Underlying production increased by 3.4% annually, to 2.207m barrels oil equivalent daily.

This reflected "new major project volumes" in the North Sea, including the Skarv field off Norway, and Angola

"The stock market doesn't want the oil majors to spend money. Instead, investors want their cash back. And BP has obliged ," said analyst Neill Morton of Investec.

BP shares closed up 5.6%, 25.4p, at 477.5p.