Ethanol prices have skyrocketed to their highest level in a decade, contributing to surging U.S. gasoline prices as oil refiners pay more for the biofuel they are required to blend with their products.

The price spike is adding grist to a yearslong political debate over the federal ethanol blending mandate, known as the Renewable Fuel Standard. Politicians from oil-and-gas states have sought to repeal the requirement, calling it ineffective and expensive, while corn-state politicians have defended it, arguing it has added to U.S. fuel supplies and decreased consumer costs.

Since the Renewable Fuel Standard, or RFS, became law in 2005, ethanol has traded at around the same price as unblended gasoline, or at a discount to it. The two have diverged this year as ethanol has increased about 157% to $3.42 a gallon in 2021, while unblended gasoline is up about 61% to $2.28 a gallon, according to FactSet data.

The price of the finished U.S. gasoline consumers buy, which includes ethanol and other additives, is up about 62% this year, the highest levels since 2014. It was about $3.40 a gallon on average Wednesday.

Most analysts agree that the primary causes of rising fuel prices are increased energy demand, spurred by an uptick in global economic activity, and oil production that hasn’t kept pace. But the cost of complying with the RFS and other regulations is currently adding nearly 20 cents to the price of a gallon of gasoline in some parts of the country, according to some analysts.

“There is a cost to environmental compliance,” said Andy Lipow, president of Lipow Oil Associates LLC in Houston. “The cost of that compliance is being passed through to the consumer.”

Mr. Lipow said that the last time gasoline was around its current price in 2014, the cost of complying with the RFS added less than 3 cents to the price of a gallon of gasoline, but now adds around 15 cents. Compliance with state-level environmental regulations, particularly those in California, are adding an additional 4 cents to nationwide gas prices, he said.

Fuel demand and traders piling into commodities as a hedge against inflation have pushed ethanol prices to record levels. Daily production of ethanol in the U.S. hit a record level of 1.11 million barrels a day in October, according to the U.S. Energy Information Administration, but has been unable to keep up with fuel demand as many drivers return to the road. Agricultural prices more broadly have risen on the back of a snarled supply chain and higher input costs for crops.

The White House is under pressure to respond forcefully to public concerns about mounting fuel costs. The U.S. and five other countries said Tuesday they will tap their national strategic petroleum reserves in an attempt to bring down gasoline prices, a move some analysts say will provide only short-term relief. Last week, President Biden called on the Federal Trade Commission to investigate whether oil-and-gas companies are participating in illegal conduct aimed at keeping gasoline prices high.