BP Plc has agreed to buy U.S. shale oil and gas assets from global miner BHP Billiton for $10.5 billion, expanding the British oil major's footprint in oil-rich onshore basins in its biggest deal in nearly 20 years.

The acquisition marks a big turning point for BP since the Deepwater Horizon rig disaster in the Gulf of Mexico in 2010, for which the company is still paying off more than $65 billion in penalties and clean-up costs.

"This is a transformational acquisition for our Lower 48 business, a major step in delivering our upstream strategy and a world-class addition to BP's distinctive portfolio," BP chief Executive Bob Dudley said in a statement.

In a further sign of the upturn in its fortunes, BP said it would increase its quarterly dividend for the first time in nearly four years and announced a $6 billion share buyback, to be partly funded by selling some upstream assets.

The sale ends a disastrous seven-year investment by BHP in the shale business, which investors led by U.S. hedge fund Elliott Management have been pressing the company to jettison for the past 18 months. BHP put the business up for sale last August.

Investors and analysts said the sale price was better than expected and were pleased that BHP planned to return the proceeds to shareholders.

"It was the wrong environment to have bought the assets when they did but this is the right market to have sold them in," said Craig Evans, co-portfolio manager of the Tribeca Global Natural Resources Fund.

Analysts said they had assumed BHP would get between $8 billion and $10 billion in cash for the assets.

BHP first acquired shale assets in 2011 for more than $20 billion with the takeover of Petrohawk Energy and shale gas interests from Chesapeake Energy Corp, but suffered as gas prices collapsed, forcing it to book massive writedowns.

The world's biggest miner said it would record a further one-off shale charge of about $2.8 billion post-tax in its 2018 financial year results.