BP boss Bob Dudley will step down as chief executive almost a decade after steering the oil major back from the brink of collapse following the Deepwater Horizon disaster.

The company said Dudley would end his four-decade career at BP early next year and be replaced in February by insider Bernard Looney, 49, currently head of exploration and production.

BP’s chairman, Helge Lund, said the company owes Dudley, who earned $14.7m (£11.7m) last year, a debt of gratitude for his work rebuilding the company after the deadly oil spill in the Gulf of Mexico in 2010.

He credited Dudley with steering the company through “probably the most challenging time in BP’s history” to help “re-earn its position as one of the leaders of the energy sector”.

Facebook Twitter Pinterest Bernard Looney, BP’s head of exploration and production, is lined up to replace Dudley. Photograph: BP

The worst oil spill in US history, which killed 11 people and took a heavy toll on local communities and the environment, pushed BP close to financial collapse and cost the company more than $65bn in compensation.

The second half of Dudley’s tenure as chief executive was marked by one of the most severe oil market downturns in history, in which global oil prices plunged from more than $100 a barrel to 12-year lows of under $30 a barrel in early 2016.

Last year, BP said it had doubled its profits from the year before to $12.7bn, its highest in five years and well above the expectations of industry analysts. It also agreed a $10.5bn deal to buy BHP Billiton’s US shale business, its biggest acquisition since Macondo.

Dudley could receive up to £40m in company shares after he leaves, earned through the company’s bonus scheme over the last decade that are linked to BP’s performance and have yet to be paid out.

He has received a total of about $116.5m while chief executive of BP. His biggest payout, a remuneration package worth $19.4m for 2015, followed record losses at the company, thousands of job cuts and a pay freeze for employees. The windfall ignited outrage among shareholders who voted down the pay pledge by 60% at BP’s 2016 annual shareholder meeting.

Looney said he was looking forward to “building on the strong foundation” left by Dudley to “meet society’s demand for cleaner, better energy”.

BP is under fierce pressure from activists and investors to reduce its carbon footprint, and take responsibility for its contribution to the climate crisis by moving away from oil production towards renewable electricity and alternative fuels.

Earlier this week the Royal Shakespeare Company said it would end its sponsorship deal with the company amid growing opposition to fossil fuel sponsorship of many of the UK’s leading cultural institutions.

Lund said BP’s incoming chief executive “has all the right qualities” to help BP chart a new course through a “transformational era” towards a low-carbon future.

“He has deep experience in the energy sector, has risen through the ranks of BP, and has consistently delivered strong safety, operational and financial performance. He is an authentic, progressive leader, with a passion for purpose and people and a clear sense of what BP must do to thrive through the energy transition,” he said.

Sign up to the daily Business Today email or follow Guardian Business on Twitter at @BusinessDesk

Looney, an Irish citizen, first joined BP in 1991 as a drilling engineer and took control of the company’s exploration and production business at the depths of the oil market crash in the spring of 2016. He has worked for the company in the North Sea, the Gulf of Mexico and Alaska.

Dudley described his successor as “a terrific choice” who “knows BP and our industry as well as anyone but is creative and not bound by traditional ways of working”.

“It has been the privilege of a lifetime to serve this company and work in this industry for the past four decades. I have worked with so many committed people from all over the world – both inside and outside BP – and I am enormously proud of all the things we have achieved together to provide energy for the world,” Dudley said.