The deal will allow CF Industries, which supplies most of the CO2 used in food production, to restart its factory in Billingham, Stockton-on-Tees.
It had halted two of its fertiliser factories due to soaring gas prices.
The BBC understands the deal could cost tens of millions of pounds.
It is also expected the plant will need up to three days to start CO2 production, and only one of the company's factories will restart - its Cheshire plant remains closed.
In a statement, the government said it would provide support for CF Fertilisers' operating costs for three weeks "whilst the CO2 market adapts to global prices".
Business Secretary Kwasi Kwarteng said the "exceptional short term arrangement" would ensure industries that rely on a stable supply of CO2 "have the resources they require to avoid disruption".
CO2 is widely used in the food industry in brewing and in packaging for meat and salads to prolong shelf life.
The business secretary previously ruled out nationalising the company, although providing financial support is still seen as an unusual move.
The deal comes after one food industry group warned that consumers could start noticing gaps on supermarket shelves within days if there was no intervention in its supply.
Carbon dioxide, produced at the two plants as a by-product, is used when slaughtering pigs and chickens to stun them.
It is also used in beer and fizzy drinks, as well as in the vacuum-packing process.
Ian Wright, the chief executive of the Food and Drink Federation, told the BBC earlier on Tuesday that consumers could start noticing shortages in poultry, pork and bakery products within days.
"We probably have about 10 days before this gets to the point where consumers, shoppers and diners notice that those products are not available," he said.
"It is a real crisis," he added, saying that poultry and pork production would be seriously affected by the end of this week without intervention.
He also called on the government to support other fertiliser producers and help food producers to look for alternatives to CO2.
The BBC understands that the deal with CF Industries has been drafted so that other companies who stop production due to high commodity prices will not be able to ask the government for similar help.
Norwegian firm Yara has also cut production at a number of European factories, including one in Hull.
Business Secretary Kwasi Kwarteng had said previously that "time is of the essence" in organising the deal with CF Industries, acknowledging that "it may come at some cost".
A spokesman for the British Meat Processors Association said a "key question" for the industry was "when will the plants be back on stream, as every day of disruption has knock-on effects for the meat processing industry".
Andrew Opie, director of food and sustainability at the British Retail Consortium, also welcomed the deal but said it was "vital" that production "is restarted as soon as possible, and [CO2 is] distributed quickly to food manufacturers in need of it".
The president of the National Farmers' Union, Minette Batters, added: "It's important this restart is meaningful and sustained.
"Users of carbon dioxide were given little to no warning that supplies were going to be cut off - an indication of market failure in a sector supporting our critical national infrastructure."
On Tuesday, Prime Minister Boris Johnson urged people not to worry about putting food on the table this winter, amid rising energy and food bills and a cut to universal credit.
Wholesale prices for gas have surged 250% since January, with a 70% rise since August alone, leading to calls for support from the industry, and the collapse of some smaller energy firms.
The resulting shortage of carbon dioxide saw warnings about the potential impact on food suppliers, as well as the NHS and the nuclear industry, where it is used as a coolant.
Mr Opie added that the government should also take action on other issues affecting food retailers in recent weeks, such as the shortage of HGV drivers, which has been exacerbated by the pandemic and many drivers returning to the European Union after Brexit.