As fire ripped through the Mendocino County, Calif., hills the summer of 2018, burning a vast expanse of forest and turning buildings to ash, a curious thing was happening at Eddie Ranch, a sprawling property scorched by the flames.

Its owners were petitioning the state to allow it to be paid millions to preserve trees destroyed by the inferno.

Eddie Ranch said the trees would fight climate change, asserting in its application for California’s carbon “offset” program that they would absorb some 280,890 tons of greenhouse gases. Polluters use the program to outsource their obligations to fight global warming: The credits purchased from faraway forests allow them to claim greenhouse gases they release at their facilities are not hurting the planet.

The bulk of the Eddie Ranch carbon credits would be bought by PBF Energy, which was looking to erase — on paper — emissions from its hulking oil refineries in Torrance and Martinez, Calif., and the gasoline they sell to the motoring public.

Incinerated trees, of course, can’t help the climate. But months after the 2018 fire that burned enough of Eddie Ranch to make nearly all of its planned carbon credits useless in the fight against global warming, the state of California allowed the operation to sell those credits to polluters, basing its decision on the state of the ranch before the fire.

“How do they get away with this stuff?” said Ricardo Pulido, executive director of the nonprofit Community Dreams in Wilmington, Calif. The South LA clean-air activist is among many exasperated that state climate laws allow oil companies to use the arcane offset system to pollute in communities like his.

PBF said it purchased the credits without checking their origin, and thus was unaware they were linked to Eddie Ranch.

Eddie Ranch was one more puzzling transaction at a time the state’s entire multibillion-dollar market of carbon offsets — most of them generated in distant forests — is under siege.

To comprehend what went down at Eddie Ranch, said Grayson Badgley, a postdoctoral fellow at Columbia University and Black Rock Forest in New York’s Hudson Valley, “imagine a general contractor finalizing the sale of a soon-to-be-completed home while the house under construction is actually in flames.”

California is leading the world in confronting climate change. Its push toward renewable electricity is inspiring other states and countries to step up their goals. The state’s strict rules on tailpipe emissions and its plans to ban sales of new gas-powered cars and SUVs by 2035 are forcing the auto industry to reckon with its outsize role in global warming.

Yet the opaque carbon trading scheme that is a linchpin of the state’s climate efforts — California is leaning on it to meet as much as half of its greenhouse gas reductions — is under serious strain at home even as it is getting copied far beyond California.

The U.S. Senate in late June passed a measure that would substantially expand the market for government-certified offset credits, helping farmers sell them to polluters for practices that many scientists worry won’t help the climate. Such credits could allow the owner of a refinery or plastics factory or power plant in one part of the country to pollute more if they give a farming operation in another part of the country money to tend to their soil in a certain way or use specific types of manure.

The state of Washington is launching a carbon market modeled after California’s, and China is opening its own marketplace. Both allow companies to pollute more if they pay faraway landowners to plant and preserve trees.

Meanwhile, an unregulated cottage industry of firms selling credits to corporations eager to brand as “carbon-neutral” is exploding in the U.S., peddling offset projects that many experts warn quite frequently are not soaking up the greenhouse gases claimed.

The agency charged with enforcing the state’s climate rules, the California Air Resources Board, is determined to stay the course, even as its task force on offsets was rocked by the resignation in February of its environmental advocacy and environmental justice representatives, who wrote blistering letters declaring the offset program broken and tainted by self-dealing.

“Most of the members of the Task Force either represent organizations that have a vested interest in expanding the use of offsets or have ties to industries and organizations that stand to benefit financially from offsets,” said the resignation letter penned by Brian Nowicki, the state climate policy director at the Center for Biological Diversity.

The officials overseeing the state’s climate program aggressively dispute complaints that the offsets are hurting the “fence line” communities in the shadow of the polluting refineries and factories that are using them. Rajinder Sahota, deputy executive officer for climate change and research at the Air Resources Board, said the greenhouse gas emissions from refineries are separate from emissions that contribute to asthma and other health problems.

“The program has worked exactly as we expected,” she said. “There is nothing untoward. There are no questions of its legitimacy.”

The California regulators are also tangling with a credentialed group of scholars at Stanford, UC Berkeley, UC Santa Barbara, Columbia University, and the University of Utah who have concluded the state is significantly exaggerating the environmental value of the offsets California polluters are buying.

“We have documented over $400 million worth of credits issued that we think don’t help the climate,” said Danny Cullenward, a lecturer at Stanford and policy director of CarbonPlan, the nonprofit research group created by the scientists. Those dubious credits alone would permit companies to release from their facilities in California the amount of greenhouse gas generated by 6.5 million cars over a year on the road.

CarbonPlan published a database of 65 offset projects to illustrate how lenient — and ineffective — it believes California’s guidelines are. The scientists found the data the state is using to assess properties are flawed and, on average, inflate the greenhouse-gas-absorbing potential of forests in the program by nearly 30%. The state rejects the findings, which have touched off heated debate among forestry experts and preservation groups. The study by CarbonPlan, which Badgley helped lead, is currently undergoing peer review.

The report is just one of many yellow flags flying around the offset program. There is an even larger question of how many properties in the program were ever in danger of being logged or developed at all. The credits are doing nothing for the climate — and actually damaging it — unless they are creating new “carbon sinks” to soak up harmful greenhouse gases.

“This falls into the category of, ‘If it looks too good to be true, you need to look more carefully,’” said Charles Canham, a longtime forest ecologist and manager who regrets helping the Great Mountain Forest in Connecticut get approval to sell millions of dollars’ worth of the credits to California polluters through the program.

The problem with the deal, Canham said, is that the land was already preserved by a local foundation and being managed in a way that would soak up carbon. “We are paying landowners to keep doing what they were already doing,” he said. “People are being unrealistic in claiming this will increase the magnitude of the nation’s carbon sink.”