The company said the deal would make Total the second-largest operator in the North Sea, with substantial operations in Britain, Norway and Denmark.
It will pay for the company with $4.95 billion in Total shares, while taking on $2.5 billion of Maersk Oil's debt.
The boards of both companies have approved the deal.
Total said the acquisition would bolster its positions in the Gulf of Mexico, Algeria, Kenya and Kazakhstan.
“This transaction delivers an exceptional opportunity for Total to acquire, via an equity transaction, a company with high-quality assets which are an excellent fit with many of Total's core regions,” chief executive Patrick Pouyanne said in a statement.
He said that once completed in the first quarter of 2018, the deal would generate some $400 million in cost savings and other synergies each year, which would immediately help to increase the combined group's cash flow and earnings per share.
“We are also very pleased that we will have a new anchor point in Denmark which will host our North Sea business unit and supervise our operations in Denmark, Norway and the Netherlands,” Pouyanne said.
Total embarked on a cost-saving drive three years ago in response to falling oil prices, but had recently signalled it was once again ready to pursue acquisitions.
Since 2014, oil prices have dropped dramatically and remained stubbornly low, a trend that has weighed heavily on the industry.
READ ALSO: Maersk summoned by US fair trade authorities
“We imagine the investors won't be overly enthused with the idea of buying more oil barrels when they are overly concerned with falling oil demand,” said analysts at Alliance Bernstein.
“Investors should however think of these as high-margin low-cost barrels” that will recoup costs even if the price of oil falls to $30 per barrel from its current level around $50.
It also noted the price in terms of output was nearly a third less than Shell sold its North Sea portfolio to Chrysaor earlier this year.
Shares in Total initially fell, but by afternoon were up 0.3 percent at 42.76 euros per share while Paris's CAC 40 index was down 0.3 percent.
Shares in Maersk jumped by 3.3 percent.
Ane Maersk Mc-Kinney Uggla, who heads the A.P. Moller Holding company, said “this is a very difficult, but right decision”.
“Maersk Oil has for almost half a century been at the forefront of the Danish oil development, been vital to A.P. Moller-Maersk and to this very day plays a decisive role in the Danish and international oil and gas industry,” she said.
The company had announced in September that it was splitting its transport and energy divisions as it faced headwinds in both sectors, while signalling that it would sell off its oil businesses.
It posted a heavy loss for 2016 after taking substantial write-downs on the value of its oil services division, which prompted board chairman Michael Pram Rasmussen to announce his resignation.