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.
“This is a win for tens of thousands of workers and for the dignity of their work,” Mr Biden said at a news conference. “They earned and deserve these benefits, and this is a great deal for both sides.”
“We reached an agreement that will keep our critical rail system working and avoid disruptions of our economy,” he added.
Heated contract negotiations have been taking place for three years between railroad management and the dozen unions that represent more than 100,000 workers.
Ten unions had agreed to the most recent contract offer, but until Thursday two of the largest unions in the country – representing the engineers and conductors who make up two-person train crews – held out.
They complained that staffing shortages and workplace attendance policies have created punishing schedules for staff.
Workers say they are effectively on call throughout the year, with no paid time off in some cases even if they are unwell or have other personal emergencies.
More than one million Americans worked on the railroads in the 1950s, but the industry now employs fewer than 150,000 people, according to data from the Bureau of Labour Statistics.
Cost-cutting has led to the culling of some 45,000 jobs over the last six years, putting pressure on those who have remained in their jobs.
Analysts had warned a strike would result in supply chain chaos and cost the economy more than $2bn a day. In anticipation of service interruption, the Amtrak passenger rail service cancelled all of its long-distance services around the country for Thursday.
President Biden personally called rail unions and companies earlier in the week. Labour Secretary Marty Walsh, a former union leader himself, secured the deal after the marathon talks.
The two holdout unions, BLET and Smart, credited the duo and other Democrats for “allowing for an agreement to be reached across the bargaining table, rather than through legislation”.
“The solidarity shown by our members, essential workers to this economy, who keep America’s freight trains moving, made the difference,” it added.
The agreement will now go before union members for a ratification vote.
The parties have also agreed that, if the vote fails, there will be a “cooling off period” before any strike action is taken.