At his dairy farm in Dracut, Warren Shaw can’t avoid paying record-high diesel prices.

He relies on diesel tractors to harvest hay and corn he grows for his cows. The box trucks that bring his milk and ice cream to customers also run on diesel. Meanwhile, as his farm constructs a new production facility, the rising price of fuel is driving up building costs.

“It’s a real expense problem,” said Shaw, who’s president of the Massachusetts Farm Bureau Federation. “The whole chain, starting with the on-the-ground farm production expenses, are significantly increased by what’s going on with the energy markets.”

Support for GBH is provided by:

According to the American Automobile Association, the national average for a gallon of diesel is $6.51, up nearly three dollars from a year ago. The Massachusetts average is $6.38. The spike is primarily due to Iran’s chokehold on oil exports through the Strait of Hormuz in response to attacks from the United States.

The high prices are permeating through supply chains and eating into farmers’ already tight profit margins at a time when they’re especially reliant on diesel.

September marks the beginning of the fall harvest season, when farmers use tractors and trucks to clear their fields and bring products to customers. That can entail burning through hundreds of gallons of diesel a day, amounting to huge losses on higher fuel prices.

“A large 150 to 200 horsepower tractor is going to make diesel go away real quick,” Shaw said. “All of the farmers in the commonwealth of Massachusetts are being affected by the diesel shortage.”

While farming isn’t as expansive an industry in Massachusetts as other parts of the country, the state has roughly 7,000 farms that generate $10 billion in annual economic activity and help support local food security.

The surging diesel prices are the latest blow for farmers who’ve watched the costs of fertilizer and replacement parts for equipment rise. A worsening labor shortage amid stricter immigration enforcement has also made it hard for some farmers to fill jobs.

Support for GBH is provided by:

Shaw said he’s trying to absorb the higher costs without increasing prices for his milk and ice cream, but he’s not sure how much longer that can continue. Other farmers have already started increasing their prices.

At Runnymede farm in Westhampton, owner Karl Norris uses four diesel tractors to grow hay and thousands of pumpkins every year. In addition to fuel prices rising, he’s spending more on maintaining his tractors as tariffs make it hard for him to find replacement parts. He’s responded by increasing prices for his hay, although he’s kept his pumpkin prices stable.

“We don’t feel consumers have a lot of money to spend” on pumpkins, Norris said. “Farmers wouldn’t be in business if they didn’t stay optimistic. But having said that, the number of expenses that are increasing is pretty staggering.”

Norris and Shaw said that fortunately, Massachusetts offers grants and other forms of support to help cushion the financial challenges farmers are confronting. For example, Shaw pointed to the Food Security Infrastructure Grant Program, which provides farmers funding to help scale up their operations.

Still, he said the current price pressures on farmers are unsustainable. Farmers have tried to trim expenses in other areas to make up for rising fuel prices, Shaw said. But he added they’re reaching a point where they don’t have much more to cut.

And once the farming season ends, many farmers don’t expect the financial challenges to ease. Shaw said he’ll need to use heating oil — the price of which is also spiking — to power his dairy pasteurization facility. He’s also already thinking about the potential cost of fertilizer for the 2027 growing season.

“Frankly, the economy has been not reliable in any way for the past several years,” Shaw said. “But more importantly, now during the sort of war-related energy crisis, it’s almost a disaster at this point.”