Oil and gas giant BP has reported a greater-than-expected increase in third-quarter profits on the back of the recent increase in oil prices.

The company posted underlying replacement cost profit, which is its preferred measure of profit, of $1.87bn (£1.41bn) between July and September compared to a profit of $933m in the same period of 2016.

Analysts had expected BP's third-quarter profits to come in at $1.58bn.

The company kept its quarterly dividend unchanged at 10 cents per share and announced that it would buy back shares in the fourth quarter to dilute the impact of its scrip dividend programme.

Brent crude prices increased by about 20% during the third quarter – the biggest increase recorded for that period since 2004 – boosting the oil major's results.

Reported oil and gas production was 14% higher than the third quarter of 2016 as three major upstream projects – in Australia, the Caribbean and the Middle East – all began production.

"Three new upstream projects and the highest downstream earnings in five years, underpinned by reliable operations and disciplined spending, have generated healthy earnings and cash flow," BP chief executive Bob Dudley said.

"There is still room for further improvement and we will keep striving to increase sustainable free cash flow and distributions to shareholders."

Underlying replacement cost profits for the first nine months of the year came in at $4.06bn, up from $2.19bn in the same period a year ago.