In a bid to tamp down the Golden State’s highest-in-the-nation gas prices, California lawmakers on Monday passed legislation to set up the country’s first watchdog body tasked with investigating the oil industry.

The bill, SBX 1-2, which passed the State Assembly in a 52-19 vote on Monday, is the culmination of a bitter battle between Gov. Gavin Newsom and some of the country’s largest oil companies after the state saw gas prices topping $6.40 a gallon twice last year. After a large dip over the winter, California gas prices have slowly ticked higher to an average of $4.82 on Monday.

Newsom slammed the industry for “price gouging,” an accusation that gained political traction after oil giants reported historic profits. But industry representatives said the state’s environmental regulations, high taxes, and the transition away from fossil fuels are the cause of high prices and an increasingly volatile gas market.

“There’s truly no other explanation for these historically high prices other than greed,” Assemblymember Pilar Schiavo, a Southern California Democrat, said on Monday during a hearing in Sacramento. “The problem is we don’t have the information to prove this, and we don’t have the ability to penalize the kind of historic price gouging we saw last year.”

The current legislation is a comprise between lawmakers and the governor. In December, Newsom proposed legislative language that would set an across-the-board cap on profits by the state’s oil refineries. If refiners exceeded those profit margins, they would face financial penalties.

Now, the Legislature is kicking responsibility to a new watchdog body, backed by subpoena powers, within the California Energy Commission. Based on findings from the watchdog entity, the commission could issue penalties at its discretion on the state’s oil refiners.

Any regulatory action and resulting profits penalty could take months or far longer as the energy commission sets up multiple new bodies, establishes a lengthy rulemaking process, and institutes complex new reporting requirements governing oil refiner data.

“If we experienced some price spikes, like immediately in the next few months, there won’t be a lot of ability to respond,” State Senator Nancy Skinner, who authored the bill, said in an interview last week. “A good portion of the bill is new disclosures that would be required. So we’ll take some time to do that and it will take some time for the experts to analyze it.”

The legislation gives the governor power to appoint the head of the new watchdog body, called the Division of Petroleum Market Oversight, subject to Senate authorization. Another oversight body, the Independent Consumer Fuels Advisory Committee, will be comprised of academic and legal experts along with representatives from organized labor, consumer advocacy, and the oil industry.

“We’ll comply. We comply with every law,” said a senior oil industry source. He said the legislation is meant to “deflect the real issue around California policies: They’re trying to drive energy business, energy companies out of business for the replacement of electric vehicles.”

Republican lawmakers also blasted the legislation, they say the answer to reducing gas prices is suspending the state’s 54-cent gasoline tax, which is used to fund highway and transportation projects.

“The fact remains that (this legislation) acts as a tax,” said Assemblymember Jim Patterson of Fresno, who said the bill is being rushed through the lawmaking process. “This is an unprecedented use of legislative and executive power, and I object to it strenuously.”

Consumer Watchdog, which called for the profits cap, has backed the revised legislation along with Severin Borenstein, a leading gas prices expert at UC Berkeley.

Borenstein said the law will finally give the state regulatory teeth to pull back the curtain on California’s opaque oil-refining market. The state’s oil refineries, including Chevron, Valero, and PBF Energy, closely guard information on their operations and pricing as confidential trade secrets.

California has seen perennial calls for gas price investigations spanning decades and multiple governors. But little has come from previous investigations, meanwhile, and all sides agree that the majority of California’s high gas prices are due to hefty taxes and fees. A special fuel blend used in California, which helps prevent air pollution, also causes some of the high gas prices.

But Borenstein, who has studied gas costs for years identified a gap between Golden State fuel costs and the national price that is not accounted for by the state’s taxes and regulatory factors. That gap, which Borenstein calls a “mystery surcharge,” is typically around 30 to 40 cents. Over the summer the gap exploded to over a dollar underscoring the state’s shaky grasp on the oil-to-gasoline supply chain.

The legislation is now headed to the governor’s desk, where he is expected to sign it this week.