BP has agreed to buy US shale oil and gas assets from global miner BHP for $10.5 billion, expanding the British oil major's footprint in some of the nation's most productive oil basins in its biggest deal in nearly 20 years.

The acquisition of about 500,000 producing acres marks a 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 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.

BP's London-listed shares were trading 0.4% higher, compared with a 0.8% gain in the broader European energy index .SXEP.

The sale ends a disastrous seven-year foray by BHP into shale on which the company effectively blew up $19 billion of shareholders' funds. Investors led by US hedge fund Elliott Management have been pressing the mining company to jettison the onshore assets for the past 18 months. BHP put the business up for sale last August.

The sale price was better than the $8 billion to $10 billion that analysts had expected, and investors were pleased that BHP planned to return the proceeds to shareholders.