US freight rail companies and unions representing their workers have reached a "tentative agreement" to avert the first national rail strike in 30 years.
The deal follows months of back and forth negotiations and 20 hours of overnight talks on working conditions.
President Joe Biden hailed the outcome as "an important win for our economy and the American people".
The strike would have impacted millions of Americans and cost the economy an estimated $2bn (£1.7bn) a day.
It would also have disrupted passenger services, as many of these trains run on tracks that are operated and maintained by freight carriers.
The agreement, which was announced early on Thursday, ensures that a strike that had been due to begin after midnight on Friday will no longer take place.
The deal includes a 24% wage increase and $5,000 bonuses, as well as changes to existing policies on time off which had been a crucial sticking point for workers.