Can an oil and gas company become a net-zero emitter of greenhouse gases?

The Spanish company Repsol thinks so. On Monday it announced that it will become a net-zero emitter by 2050 and that it would immediately mark down the value of its oil and gas reserves by $5.3 billion after using a new climate change scenario.

The company said that it would continue to search for oil and natural gas but that it would focus on places that provided value over volumes, while it pushes ahead with renewable-energy and biofuels investments.

Eliminating carbon emissions at any corporation would be a difficult task, but it will be especially difficult at a company that relies on the production and sale of fossil fuels. And unlike other major oil and gas companies that have set narrow emissions targets, Repsol is counting the emissions from the automobiles and power plants that use Repsol products — what environmentalists call “Scope 3” emissions.

“What makes this announcement truly precedent-setting is that Repsol’s net-zero target encompasses all of the categories of emissions,” Pavel Molchanov, energy analyst at the investment advisory firm of Raymond James, said in an email. “Repsol’s pledge covers the emissions from its own operations as well as the carbon footprint of the petroleum fuels and natural gas used by its customers.”

ENI, the Italian oil giant, said it would reach net-zero emissions by 2030, but without counting customer use, Molchanov said. Other large oil companies have set partial decarbonization targets, but also without taking responsibility for what their customers do.

Earlier this year, Vicki Hollub, chief executive of Occidental Petroleum, said she wanted the fifth-biggest U.S. oil and gas company to be carbon neutral, but she has not established a timetable. Occidental has invested in NetPower, a carbon capture project that could supply carbon dioxide for enhanced oil recovery in the Permian Basin, where Occidental is a dominant player. But that would make only a small dent in the company’s emissions.

Repsol has left itself some leeway in the early years. A Bloomberg Intelligence analysis said that the company would have to spend hundreds of millions of dollars by 2025 to buy carbon offsets to meet its goals. But the company said that was not the case, because the early targets are tied to a ratio of emissions to total energy produced, meaning that expansion of its renewable and biofuels projects could help it meet its early targets. And the steepest reductions come after 2040.

J. Robinson West, a veteran oil industry expert and independent member of the Repsol board of directors, said that “the company has a strategy for cutting emissions in all operations as aggressively as possible.”

Repsol said that it can achieve 70 percent of its emissions reduction using existing technology. But the last decade of improvement will have to rely on new technology or on agriculture and reforestation projects.

“How they can get to zero is the big question,” West said. “The answer is you can be more efficient, generate more renewables and produce new materials. And the key is carbon capture and natural sinks.”

Repsol is among the smaller of the world’s major oil companies, but it is far-flung. It operates in 35 countries and produces the equivalent of 713,000 barrels a day, with one-third oil and two-thirds natural gas. Its holdings include production in Pennsylvania, Texas and Alaska. It has 2,952 megawatts of renewable energy and has 1,083 megawatts under development. The board has approved two photovoltaic solar-power plants and a wind project.

While the company wrote down the value of its oil and gas reserves, it did not label them stranded or abandon oil and gas exploration. The write-down was solely because of a dimmer price outlook. The company said it used a scenario that took into account the Paris climate accord.

Company spokesman Kristian Rix said that Repsol’s oil and gas reserves would be used up in eight years without further exploration. As a result, the company would invest in exploration to keep its output stable, while also investing in renewables and biofuels.

Rix said the new effort was in line with the company’s “ethos.” Repsol was the first oil and gas company to support the Kyoto Protocol that sought to curb carbon dioxide emissions in 1997, and it linked the pay of refinery workers to reductions in emissions in 2012. Today investors concerned about environment and sustainability goals own about 15 percent of Repsol shares and 30 percent of the shares held by institutional investors, more than the average oil and gas giant.

Repsol also said it would add new internal incentives to reduce emissions. The company said it would use a hypothetical price for carbon emissions, starting at $25 a ton in 2018, with an increase of up to $40 a ton by 2025. That price would rise to $70 by 2040.

The company also said it would link at least 40 percent of the long-term bonus and other nonsalary pay of its top executives to objectives that lead the company to comply with the 2015 Paris agreement.

Repsol’s commitment follows on the heels of an announcement by a company at the other end of the oil and gas industry — Harmony Fuels, a subsidiary of a gasoline and diesel wholesale business in central Pennsylvania. Founded last month, Harmony offers retail customers from Maryland to Maine the option of paying for carbon offsets to balance out their purchases of propane or home heating oil. So far, Harmony has signed up 30 customers who have offset 107,000 pounds of carbon, a tiny amount.

“As we expected, we are a little slow to start with,” said Steven Downey, president of Harmony Fuels and vice president of marketing at Shipley Energy, the parent company.

Opinion polls suggest that it could be a difficult business to build. In a climate poll conducted last summer by The Washington Post and the Kaiser Family Foundation, nearly half of adults said they would pay a $2-a-month tax on electricity to combat climate change and just over a quarter said they would pay $10 extra a month.

Downey said that Shipley started surveying its customers and found the response on carbon offsets “more positive than expected.” When asked whether they would pay for the offsets, about 55 percent of those surveyed said that they would do it or that it would depend on the cost.

Harmony is trying to lure customers by letting them earmark their payments to certain projects, including ones in their own states. The projects include one that would capture methane from a landfill in Massachusetts; wind farms in Maine and Texas; solar-panel sites in Virginia; and improved forest management.

Downey said that he was impressed by Repsol’s announcement of net-zero emissions by mid-century. “2050 is great,” Downey said, “but we’re pretty proud we have something people can invest in today.”