Biden called the deal a "big win for America" and for tens of thousands of rail workers. Thanking business and labor, the Democratic president promised more worker-company agreements in the future.
"I'm optimistic that we can do this in other fields as well," Biden said.
"Unions and management can work together for the benefit of everyone," Biden added.
If they accept the deal that was announced at about 0900 GMT, workers whose pay had been frozen will win double-digit increases and will be allowed to seek certain types of medical care without fear of being punished, union leaders said. The agreement includes an immediate 14.1% wage rise, the railroads said.
Unions, whose members bitterly rejected prior proposals, will now vote on the agreement. Even if those votes fail, a rail strike that could have happened as soon as a minute past midnight on Friday has been averted for several weeks due to the standard language included in such a deal, a person familiar with the negotiations said.
Biden's Labor Secretary Marty Walsh hosted contract talks in Washington that ran for 20 consecutive hours between unions representing 115,000 workers and railroads including Union Pacific, BNSF, CSX, Norfolk Southern and Kansas City Southern .
Officials are expected to host a news briefing later on Thursday.
A rail
shutdown could have frozen almost 30% of US cargo shipments by weight, stoked
inflation, cost the US economy as much as US$2 billion per day and unleashed a
cascade of transport woes affecting the US energy, agriculture, manufacturing,
healthcare and retail sectors.
Railroad shares pared initial pre-market gains after mixed economic data, with Union Pacific up 2.2% in mid-day trading and CSX down 2.0%.
US natural gas futures dropped about 9% after soaring 10% in the prior session; oil futures fell about 4% to a one-week low. Diesel and gasoline futures also fell.
Investors expected that a rail strike would have threatened coal supplies to power plants and boost demand for rival energy sources.
Amtrak, which runs passenger rail, said it will resume normal service on Friday after cancelling long-distance trains in anticipation of a strike.
The impact of a shutdown would have stretched beyond US borders because trains link the United States to Canada and Mexico and provide vital connections to massive ships that ferry goods from around the globe.
Negotiations between the companies and a dozen unions had stretched for more than two years, leading Biden to appoint an emergency board in July to help break the impasse. Biden personally called Walsh and negotiators on Wednesday evening to prod them toward a deal, telling them "once again to recognize the harm" that a shutdown would have on families, farmers and businesses, according to a person aware of the negotiations.
National Retail Federation CEO Matthew Shay thanked Biden's administration for intervening, adding in a statement that his group is "relieved and cautiously optimistic." Emily Skor, CEO of the biofuel trade group Growth Energy, also praised the deal and noted that much of the country's ethanol moves by rail.
Freight railroads had halted transportation of hazardous goods, including chlorine for water purification and ammonia for fertilizer, as well as shipments of refrigerated food and other goods that use rail and at least one other mode of transport. Their goal was to prevent cargo from being stranded in unsafe locations.
The railroad industry slashed almost 30% of its workforce over the last six years, cutting pay and other costs as they increased profits, stock buybacks and dividends for investors. Profits at billionaire Warren Buffett's Berkshire Hathaway, which owns BNSF, rose 9.2% in the most recent quarter to US$1.7 billion.
The number of US railway workers has dropped from over 600,000 in 1970 to about 150,000 in 2022, according to the Bureau of Labor Statistics, due technology and cost-cutting. The result is that many industry workers are on call at all hours, waiting to respond at short notice to work for days at a time.
Biden, who has called himself the most union-friendly president in history and attacked companies for raking in "excessive" profits, praised a deal he said would give workers "better pay, improved working conditions, and peace of mind around their health care costs."
The president is not yet out of the woods when it comes to supply-chain labor issues. Some 22,000 union workers at 29 West Coast ports that handle almost 40% of US imports are also in high-stakes labor contract negotiations.
Administration officials wanted the disputes resolved ahead of November's midterm elections that will determine whether Biden's fellow Democrats retain control of Congress.
Senior congressional leaders had threatened to pass legislation imposing a resolution on the railroads and unions if the negotiations were not successful.
US House Speaker Nancy Pelosi praised the tentative agreement and said that Congress was "ready to act" but that "thankfully this action may not be necessary."