BP has been one of the companies most responsible for the burning of unwanted natural gas in the busiest U.S. oil field. Now it is trying to clean up its act.

The British oil giant plans to spend about $1.3 billion to build a massive network of pipes and other infrastructure to collect and capture natural gas produced as a byproduct from oil wells in the Permian Basin of Texas and New Mexico. It plans to announce Monday that it will eliminate routine flaring of natural gas in the oil field by 2025.

BP’s investment reflects the growing pressure big oil companies face from regulators, investors and buyers of natural gas to reduce the fossil fuel’s carbon footprint and contributions to climate change.

BP has pledged to reinvent itself as a cleaner energy company, saying it will let its oil and gas fuel production fall 40% by 2030 and ultimately sell more renewable energy than oil while reducing its net carbon emissions to zero. But to finance its ambitious transformation, BP is counting on continuing revenue from oil and gas production.

“We will be producing oil and gas for decades, but it will be a certain kind of oil and gas,” said Dave Lawler, the chairman of BP America Inc. “It’s a highly profitable barrel and it’s a responsibly produced barrel.”