Total is buying Maersk Oil in a $7.45 billion deal which the French oil major said would boost its earnings and cash flow, and bolster its dividend prospects.

Danish company A.P. Moller-Maersk is selling its Maersk Oil division to Total to focus on other activities including its shipping business.

Under the terms of the deal, A.P. Moller Maersk will get $4.95 billion in Total shares and Total will assume $2.5 billion of Maersk Oil's debt.

Maersk said it plans to return a "material portion of the value of the received Total S.A. shares" to shareholders in 2018 and 2019 in the form of extraordinary dividend, share buyback or distribution of shares in Total.

The world's top oil companies have been back on the takeover trail over the last year, helped by signs of a recovery in the oil market.