Jeff McIntosh/ASSOCIATED PRESS Mining trucks carry loads of oil laden sand at an oils sands project in Alberta, Canada.

Exxon Mobil has understood the environmental risks of extracting oil from the Canadian tar sands for more than 20 years, yet continued to invest heavily in the dirty resource while lobbying against efforts aimed at limiting further development, according to a new investigation by InsideClimate News.

In combing through company documents and speaking with former Exxon employees, InsideClimate found that Exxon and its Canadian affiliate Imperial Oil “placed a risky bet” on tar sands production.

In October, Exxon disclosed that as a result of declining oil prices, it could be forced to eliminate 4.6 billion barrels of oil ― almost 20 percent of its future prospects, much of it from the tar sands ― from its reserves, the Wall Street Journal reported. At the time, a company representative said the move was not expected to alter Exxon’s future oil production.

Company documents, however, show Exxon “has known for decades that international efforts to slash greenhouse gas emissions could threaten its deepening reliance on the resource,” InsideClimate reported Tuesday.

And although Exxon and Imperial are not the only companies developing the tar sands, “they have stood apart from their peers in the strength of their opposition to emissions limits and continued determination to fully exploit the resource,” the report continues.

The lengthy investigation comes a little over a year after InsideClimate revealed that top executives at Exxon knew about the role of fossil fuels in global warming as early as 1977, then lobbied against efforts to cut greenhouse gas emissions.

The controversial Keystone XL pipeline, which President-elect Donald Trump has said he wants to see built, would carry oil from the tar sands to the U.S.

On its website, Exxon says the oil sands are a “key resource for global energy security” that will account for 25 percent of the North and South American oil supply by 2040.

The InsideClimate investigation comes at a particularly interesting time for the U.S. oil giant.

On Tuesday, Trump officially named Exxon CEO Rex Tillerson as his pick for secretary of state, describing his career as “the embodiment of the American dream.”

Tillerson’s nomination adds to environmentalists’ growing fears about what a Trump presidency will mean for the fight against climate change.

Meanwhile, the oil company continues to face mounting legal troubles, including an investigation by the Securities and Exchange Commission into how it values future projects amid climate change and plunging oil prices.

Read the InsideClimate News investigation here.