The British oil giant BP set the most ambitious climate change goal of any major oil company on Wednesday, saying that it aimed to eliminate or offset by 2050 all of the planet-warming emissions from its operations — as well as the emissions caused by the burning of the oil and gas it pumps out of the ground.

The company provided few details on how, exactly, it would achieve that difficult feat. But the pledge is another sign that major companies, including fossil-fuel producers, are facing growing pressure from investors and activists to show they are taking global warming seriously.

“We are aiming to earn back the trust of society,” said Bernard Looney, BP’s chief executive, at a news conference in London. “We have got to change, and change profoundly.”

Rising concerns about climate change pose an existential threat for oil and gas companies, since scientists have said that preventing dangerous temperature increases will require steep reductions in the use of fossil fuels. In recent years, shareholders have pressed oil companies to prepare for a future in which countries shift to electric vehicles or enact new regulations to limit carbon dioxide emissions.