When Shell sold most of its Canadian tar sands operations last week, the Anglo-Dutch oil company took a modest step towards making good on its promise to be part of the solution on global warming, rather than the problem.

Tar sands are reviled by climate change campaigners as one of the dirtiest forms of energy. The sands are a glutinous, bitumen-addled mix when extracted from the ground and a huge amount of energy is need to turn them into synthetic crude oil.

Leading scientists have warned that exploiting tar sands would be “game over” for tackling climate change, and Shell has faced shareholder rebellions in the past over the risks it faced from exploiting the carbon-intensive oil.

But the $7.25bn (£6bn) sale of the majority of its tar sands assets to an independent Canadian oil company is less about the company cleaning up its image than about cleaning up its debt. The deal is the largest single chunk so far in Shell’s $30bn divestment programme, to pay for borrowing it incurred after buying gas giant BG Group for £47bn.

“There is a low-carbon element because these are some of the most carbon-intensive barrels in the oil sector. But it’s more about a general industry trend we’re seen around repositioning portfolios lower down the cost curve,” said Tom Ellacott, senior vice-president of research at oil analysts Wood Mackenzie.

While the divestment programme and a move to cheaper sources of oil will have driven the sale, Ellacott said he was sure the carbon-intensiveness of the sands was part of the company’s thinking too.

Tar sands are not just one of the dirtiest sources of oil, but one of the most expensive because of the high cost of turning them into usable fossil fuel. That is why big players are quitting the sector. Norwegian oil company Statoil completed the sale of its tar sands assets in January, and France’s Total has sold some of its holdings. US oil giants Chevron and Exxon both downgraded their tar sands reserves because of historically low oil prices that have further reduced the profitability of such a cost-intensive asset.

Of course, Shell is not leaving the tar sands game entirely. It is retaining assets including an upgrader plant, the extremely energy-intensive element of the process of turning the bitumen extracted from the ground into crude oil.

The company does not want to overstate the carbon benefits of reducing its share in the Athabasca Oil Sands Project in Alberta – although it is keeping a 10% stake – and selling several undeveloped tar sands fields in the province. But it says the sale will bring about an absolute reduction in carbon emissions from its operations, which were 72 million tonnes last year.

“Shell is a long-time supporter of government-led carbon pricing mechanisms globally and has been a vocal supporter of both Canada’s and the state of Alberta’s climate plans,” said Ben van Beurden, Shell’s chief executive. He said retaining stakes in the tar sands would help both those plans to succeed.

Compared with some of its peers, the company talks more strongly about taking global warming seriously. “We believe climate change is real. We believe action is going to be needed. We believe we are in the middle of an energy transition that is unstoppable,” Van Beurden said during the company’s quarterly results presentation last month.

He said the company “wants to be in the vanguard” of that transition to cleaner energy. Shell created a new energy division last year which is targeting an annual spend of $1bn by the end of the decade, or 4% of the $25bn capital expenditure it plans this year. Staffers say that although the proportion may seem small compared with the rest of the company, they are determined to increase it.

Shell has become more “gassy” and less “oily” in recent years, a trend accelerated by the acquisition of BG Group and helped by the tar sands sale. Production is around half oil and half gas, which is cleaner in carbon terms.

Van Beurden is aware that getting out of tar sands has reputational benefits, as well as immediate financial ones. “The global energy system needs to evolve to one with net zero emissions,” he said, arguing that Shell had a critical role to play in that transition.

“But for us to play this role effectively will require trust, and to help build that trust our industry needs to reduce its own carbon intensity.”

Shell confirmed last week that it would tie 10% of executives’ bonuses to management of greenhouse gas emissions, although the company has not said what those carbon targets are.

Nevertheless, campaigners maintain that Shell’s approach to climate change is not credible.

Greg Muttitt, of the US-based NGO Oil Change International, said: “Shell is doing more to move from oil to gas than some of its competitors but that’s not the right move – the move needs to be to step away from fossil fuels [and into renewables].”