Amtrak says it is working to quickly restore canceled trains after U.S.President Joe Biden announced that a tentative railway labour agreement has been reached.

Amtrak said Thursday that it is reaching out to impacted customers to accommodate on first available departures.

Amtrak had cancelled a number of its long-distance trains this week as a potential strike loomed.

A strike would have disrupted passenger traffic as well as freight rail lines, because Amtrak and many commuter railroads operate on tracks owned by the freight railroads.

Railroads and union representatives had been in negotiations for 20 hours at the Labor Department on Wednesday to hammer out a deal, as there was a risk of a strike starting on Friday that could have shut down rail lines across the country.

The tentative agreement will go to union members for a vote after a post-ratification cooling off period of several weeks.